From 0ab6dab185e31fcf6f3e0cf98dc8496f02448ee8 Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 10 Aug 2023 16:05:11 +0200 Subject: Basic tests --- test/res/test.lisp | 11 ++++++++++- test/src/TestLisp.kt | 7 +++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/res/test.lisp b/test/res/test.lisp index c4406b0..f3b870c 100644 --- a/test/res/test.lisp +++ b/test/res/test.lisp @@ -20,4 +20,13 @@ (debuglog "============") (debuglog "This should fail" sc) (import :secondary) -(debuglog "This should work" sc) \ No newline at end of file +(debuglog "This should work" sc) + +(debuglog "============") +(debuglog "Running tests") +(import :ntest) +(ntest.test "Funny test" (seq + (debuglog "Funny test running") + (debuglog ((ntest.fail "Test failed"))))) + + diff --git a/test/src/TestLisp.kt b/test/src/TestLisp.kt index 5563042..fa90468 100644 --- a/test/src/TestLisp.kt +++ b/test/src/TestLisp.kt @@ -8,7 +8,10 @@ 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))) + executionContext.registerModule( + "secondary", + LispParser.parse(File(T::class.java.getResource("/secondary.lisp")!!.file)) + ) val bindings = executionContext.genBindings() - executionContext.executeProgram(bindings, otherP) + println("The results are in: ${executionContext.runTests(otherP, bindings)}") } -- cgit