Adding tests

- functional tests
- more tests
- tests tests tests

Signed-off-by: teo3300 <matteo.rogora@live.it>
This commit is contained in:
teo3300
2023-11-26 19:48:54 +09:00
parent 1f47c9f57e
commit 83e45334a5
7 changed files with 111 additions and 13 deletions

1
tests/assert_fail.mal Normal file
View File

@ -0,0 +1 @@
(assert nil)

31
tests/logic.mal Normal file
View File

@ -0,0 +1,31 @@
; positive assert
(assert true)
(assert ())
(assert 1)
; not
(assert (not false))
(assert (not nil))
(assert (not (not true)))
; or
(assert (not (or false)))
(assert (or 1))
(assert (or 1 nil false))
(assert (or 1 1 1))
(assert (or nil 1 false))
(assert (not (or nil false)))
(assert (not (or false nil)))
; and
(assert (and 1))
(assert (not (and nil)))
(assert (and 1 1 1))
(assert (not (and 1 nil false)))
(assert (not (and nil false)))
; xor
(assert (not (xor nil false nil)))
(assert (xor nil 1 nil false nil))
(assert (not (xor nil 1 false 1)))
(assert (not (xor 1 nil 1 1)))