diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lisp/arithmetic.lisp | 1 | ||||
| -rw-r--r-- | tests/lisp/comment.lisp | 1 | ||||
| -rw-r--r-- | tests/lisp/control-flow.lisp | 3 | ||||
| -rw-r--r-- | tests/lisp/test.lisp | 18 |
4 files changed, 17 insertions, 6 deletions
diff --git a/tests/lisp/arithmetic.lisp b/tests/lisp/arithmetic.lisp index 658bcda..2764b10 100644 --- a/tests/lisp/arithmetic.lisp +++ b/tests/lisp/arithmetic.lisp @@ -9,3 +9,4 @@ (assert-error (- 1 "a")) (assert-error (* 1 "a")) (assert-error (/ 1 "a")) + diff --git a/tests/lisp/comment.lisp b/tests/lisp/comment.lisp index d84a2f7..40d5081 100644 --- a/tests/lisp/comment.lisp +++ b/tests/lisp/comment.lisp @@ -5,3 +5,4 @@ ;; comment 2 3) ;; comment + diff --git a/tests/lisp/control-flow.lisp b/tests/lisp/control-flow.lisp index 5d7290d..75095ec 100644 --- a/tests/lisp/control-flow.lisp +++ b/tests/lisp/control-flow.lisp @@ -1,5 +1,7 @@ (assert-error (if (error "") 1 2)) +(defmacro inmacro x (progn ,@x)) + (let ((i 0)) (while #t (if (> i 4) @@ -28,6 +30,7 @@ (assert-error (funcall (lambda () (break)))) (assert-error (funcall (lambda () (continue)))) (assert (= 1 (funcall (lambda () (return 1))))) +(assert (= 1 (funcall (lambda () (inmacro (return 1) (return 2)))))) (assert (= 1 (funcall (lambda () (while #t (return 1)))))) (assert (= 1 (funcall (lambda () (let () (return 1)))))) (assert (= 1 (funcall (lambda () (let ((x (return 1))) (return 2)))))) diff --git a/tests/lisp/test.lisp b/tests/lisp/test.lisp index b42cc60..07bdd5b 100644 --- a/tests/lisp/test.lisp +++ b/tests/lisp/test.lisp @@ -1,8 +1,14 @@ -(load "arithmetic.lisp") -(load "control-flow.lisp") -(load "lambda.lisp") -(load "comment.lisp") -(load "macro.lisp") -(load "let-binding.lisp") +(defmacro test-module (name) + `(progn + (princ (format "[TEST] %s\n" ,name)) + (load (format "%s.lisp" ,name)) + (princ (format "[PASS] %s\n" ,name)))) + +(test-module "arithmetic") +(test-module "control-flow") +(test-module "lambda") +(test-module "comment") +(test-module "macro") +(test-module "let-binding") (exit) |
