Added the beginnings of interop tests
This demonstrates that the idea of naming Lisp 1.5 functions implemented in Clojure with all-upper names will not work with the present INTEROP operator, so some rethink is going to be needed.
This commit is contained in:
parent
75da14790c
commit
d6801ee443
2 changed files with 41 additions and 18 deletions
18
test/beowulf/interop_test.clj
Normal file
18
test/beowulf/interop_test.clj
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
(ns beowulf.interop-test
|
||||
(:require [clojure.test :refer :all]
|
||||
[beowulf.cons-cell :refer [make-beowulf-list make-cons-cell NIL T F]]
|
||||
[beowulf.bootstrap :refer [EVAL INTEROP]]
|
||||
[beowulf.host :refer :all]
|
||||
[beowulf.read :refer [gsp]]))
|
||||
|
||||
|
||||
(deftest interop-test
|
||||
(testing "INTEROP called from Clojure"
|
||||
(let [expected '123
|
||||
actual (INTEROP (gsp "(CLOJURE CORE STR)") (gsp "(1 2 3)"))]
|
||||
(is (= actual expected))))
|
||||
(testing "INTEROP called from Lisp"
|
||||
(let [expected 'ABC
|
||||
actual (EVAL (gsp "(INTEROP '(CLOJURE CORE STR) '('A 'B 'C)"))]
|
||||
(is (= actual expected))))
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue