diff options
author | nea <nea@nea.moe> | 2023-08-11 14:03:19 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-08-11 14:03:19 +0200 |
commit | 3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62 (patch) | |
tree | 7ca3fc4ac01c78839e269b3432f565ee0c31347b /test | |
parent | 69f8367389c9d6f60ca594053d9d470e5a8ec999 (diff) | |
download | nealisp-3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62.tar.gz nealisp-3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62.tar.bz2 nealisp-3ff093ebd46b32af8c9f1c73e2c147bbb1f1ef62.zip |
Restructure core bindings
Diffstat (limited to 'test')
-rw-r--r-- | test/res/scratch.lisp | 26 | ||||
-rw-r--r-- | test/res/test.lisp | 45 |
2 files changed, 39 insertions, 32 deletions
diff --git a/test/res/scratch.lisp b/test/res/scratch.lisp new file mode 100644 index 0000000..3a1fa66 --- /dev/null +++ b/test/res/scratch.lisp @@ -0,0 +1,26 @@ +(debuglog "Hello, World, here is an atom:" :iamanatom) +(defun myfun (var) (debuglog var)) +(myfun :myfunworks) +((lambda (a) (debuglog a)) :atom) +(defun testlog (a ...) (seq + (debuglog "a" a) + (debuglog "..." ...))) +(testlog :test :work :whatever) +(def helloworld (pure "hello world")) +(debuglog helloworld (helloworld)) +(debuglog "+" (+ 1.2 15)) +(debuglog "-" (- 1 3)) +(debuglog "*" (* 10 10)) +(debuglog "/" (/ 1 3 2)) +(debuglog "============") +(defun testsomething (c) (debuglog (if! c (seq (debuglog "left evaluated") (return "truthy value")) "falsey value"))) +(testsomething true) +(testsomething false) +(noop) +(debuglog "============") +(debuglog "This should fail" sc) +(import :secondary) +(debuglog "This should work" sc) + +(debuglog "============") +(debuglog "Running tests") diff --git a/test/res/test.lisp b/test/res/test.lisp index 9def7f3..19594b3 100644 --- a/test/res/test.lisp +++ b/test/res/test.lisp @@ -1,40 +1,21 @@ -(debuglog "Hello, World, here is an atom:" :iamanatom) -(defun myfun (var) (debuglog var)) -(myfun :myfunworks) -((lambda (a) (debuglog a)) :atom) -(defun testlog (a ...) (seq - (debuglog "a" a) - (debuglog "..." ...))) -(testlog :test :work :whatever) -(def helloworld (pure "hello world")) -(debuglog helloworld (helloworld)) -(debuglog "+" (+ 1.2 15)) -(debuglog "-" (- 1 3)) -(debuglog "*" (* 10 10)) -(debuglog "/" (/ 1 3 2)) -(debuglog "============") -(defun testsomething (c) (debuglog (if! c (seq (debuglog "left evaluated") (return "truthy value")) "falsey value"))) -(testsomething true) -(testsomething false) -(noop) -(debuglog "============") -(debuglog "This should fail" sc) -(import :secondary) -(debuglog "This should work" sc) - -(debuglog "============") -(debuglog "Running tests") (import :test) -(test.test "unfunny test" (seq - (debuglog "Funny test not running") - ((test.assert-eq "unfunny" "funny")) -)) -(test.test "Test equality" (seq +(test.test "Identity equality" (seq ((test.assert-eq false false)) + ((test.assert-eq true true)))) + +(test.test "Not behaves correctly" (seq ((test.assert-eq (not false) true)) - ((test.assert-eq (not true) false)) + ((test.assert-eq (not true) false)))) + +(test.test "And behaves correctly" (seq ((test.assert-eq (& true true) true)) ((test.assert-eq (& true false) false)) ((test.assert-eq (& false true) false)) ((test.assert-eq (& false false) false)))) + +(test.test "Or behaves correctly" (seq + ((test.assert-eq (| true true) true)) + ((test.assert-eq (| true false) true)) + ((test.assert-eq (| false true) true)) + ((test.assert-eq (| false false) false)))) |