Adding more tests to lisp

db4
James Cash 2008-05-18 11:59:11 -04:00
parent a2e1ad2814
commit 5c13565bc7
1 changed files with 16 additions and 6 deletions

View File

@ -6,22 +6,32 @@ IN: lisp.test
init-env
"#f" [ f ] lisp-define
"#t" [ t ] lisp-define
"+" "math" "+" define-primitve
"-" "math" "-" define-primitve
{ 5 } [
[ 2 3 ] "+" <lisp-symbol> funcall
] unit-test
{ 8.3 } [
[ 10.4 2.1 ] "-" <lisp-symbol> funcall
] unit-test
{ 3 } [
"((lambda (x y) (+ x y)) 1 2)" lisp-string>factor call
] unit-test
"-" "math" "-" define-primitve
{ 8.3 } [
[ 10.4 2.1 ] "-" <lisp-symbol> funcall
] unit-test
{ 42 } [
"((lambda (x y z) (+ x (- y z))) 40 3 1)" lisp-string>factor call
] unit-test
{ 1 } [
"(if #t 1 2)" lisp-string>factor call
] unit-test
{ "b" } [
"(cond (#f \"a\") (#t \"b\"))" lisp-string>factor call
] unit-test