if let
This commit is contained in:
1 parent
02ec06609f
commit
fc0c1bead9
2 files changed
+64
-4
No files matched your search
+20
-4
@@ -45,10 +45,26 @@
|
||||
scm/syntax->datum))
|
||||
|
||||
(t/deftest expand-test
|
||||
(t/is (= '(lambda (x) x)
|
||||
(expand #scm/stx (#scm/stx lambda
|
||||
#scm/stx (#scm/stx x)
|
||||
#scm/stx x)))))
|
||||
(t/is (thrown? Exception (expand #scm/stx x)))
|
||||
(t/testing "primitive forms"
|
||||
(t/testing "lambda"
|
||||
(t/is (= '(lambda (x) x)
|
||||
(expand #scm/stx (#scm/stx lambda
|
||||
#scm/stx (#scm/stx x)
|
||||
#scm/stx x)))))
|
||||
(t/testing "let"
|
||||
(t/is (= '(let ((x 123))
|
||||
x)
|
||||
(expand #scm/stx (#scm/stx let
|
||||
#scm/stx (#scm/stx (#scm/stx x
|
||||
#scm/stx 123))
|
||||
#scm/stx x)))))
|
||||
(t/testing "if"
|
||||
(t/is (= '(if 123 true false)
|
||||
(expand #scm/stx (#scm/stx if
|
||||
#scm/stx 123
|
||||
#scm/stx true
|
||||
#scm/stx false)))))))
|
||||
|
||||
|
||||
;;; specs
|
||||
|
||||
Reference in new issue
Block a user