From f345fadd492ea5bb09e515d007be438fc08c9b93 Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 10 Aug 2023 02:26:42 +0200 Subject: Add imports --- test/res/secondary.lisp | 3 +++ test/res/test.lisp | 4 ++++ test/src/TestLisp.kt | 1 + 3 files changed, 8 insertions(+) create mode 100644 test/res/secondary.lisp (limited to 'test') diff --git a/test/res/secondary.lisp b/test/res/secondary.lisp new file mode 100644 index 0000000..4231721 --- /dev/null +++ b/test/res/secondary.lisp @@ -0,0 +1,3 @@ + +(def sc 42) +(export sc) diff --git a/test/res/test.lisp b/test/res/test.lisp index 5f32bee..c4406b0 100644 --- a/test/res/test.lisp +++ b/test/res/test.lisp @@ -17,3 +17,7 @@ (testsomething true) (testsomething false) (noop) +(debuglog "============") +(debuglog "This should fail" sc) +(import :secondary) +(debuglog "This should work" sc) \ No newline at end of file diff --git a/test/src/TestLisp.kt b/test/src/TestLisp.kt index 7a520fb..5563042 100644 --- a/test/src/TestLisp.kt +++ b/test/src/TestLisp.kt @@ -8,6 +8,7 @@ fun main() { val otherP = LispParser.parse(File(T::class.java.getResource("/test.lisp")!!.file)) val executionContext = LispExecutionContext() executionContext.setupStandardBindings() + executionContext.registerModule("secondary", LispParser.parse(File(T::class.java.getResource("/secondary.lisp")!!.file))) val bindings = executionContext.genBindings() executionContext.executeProgram(bindings, otherP) } -- cgit