mirror of
https://github.com/teo3300/rust-mal.git
synced 2026-01-12 01:05:32 +01:00
Adding tests
- functional tests - more tests - tests tests tests Signed-off-by: teo3300 <matteo.rogora@live.it>
This commit is contained in:
1
tests/assert_fail.mal
Normal file
1
tests/assert_fail.mal
Normal file
@ -0,0 +1 @@
|
||||
(assert nil)
|
||||
31
tests/logic.mal
Normal file
31
tests/logic.mal
Normal 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)))
|
||||
Reference in New Issue
Block a user