beowulf/test/beowulf/interop_test.clj
Simon Brooke d6801ee443 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.
2019-08-30 14:30:54 +01:00

19 lines
649 B
Clojure

(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))))
)