Adding some info functions and tests

This commit is contained in:
teo3300
2024-04-16 09:35:35 +09:00
parent 5c9aa39750
commit 0ec8923abc
10 changed files with 108 additions and 9 deletions

6
tests/atoms.mal Normal file
View File

@ -0,0 +1,6 @@
; atom?
(assert (atom? (atom 1)))
(assert (not (atom? 1)))
; deref
(assert-eq (deref (atom 1)) 1)

View File

@ -31,7 +31,6 @@
(assert-eq (do) nil)
(println :ififififififififif)
; if
(assert (if true 1))
(assert (not (if false 1)))

View File

@ -5,5 +5,5 @@
; empty?
(assert (empty? ()))
(assert (empty? (list)))
(assert (not (empty? ())))
(assert (not (empty? (list (1 2 3)))))
(assert (not (empty? '(1 2 3))))
(assert (not (empty? (list 1 2 3))))