Skip to content

Commit

Permalink
Minor test tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Bell committed Dec 5, 2015
1 parent 761ea3f commit e30be7c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test.l
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
(test= more (read "`(a b ,(z" more))
(test= more (read "`\"biz" more))
(test= more (read "'\"boz" more)))
(test= (list false "Expected ) at 5") (cut (guard (read "(open")) 0 2))))
(let ((ok msg) (guard (read "(open")))
(test= false ok)
(test= "Expected ) at 5" msg))))

(define-test boolean
(test= true (or true false))
Expand Down Expand Up @@ -466,13 +468,13 @@ c"
(test= 12 a))))

(define-test guard
(let-macro ((guard2 (x) `(cut (guard ,x) 0 2)))
(test= '(true 42) (guard2 42))
(test= '(false foo) (guard2 (error "foo")))
(test= '(false foo) (guard2 (do (error "foo") (error "baz"))))
(test= '(false baz) (guard2 (do (guard2 (error "foo")) (error "baz"))))
(test= '(true 42) (guard2 (if true 42 (error "baz"))))
(test= '(false baz) (guard2 (if false 42 (error "baz"))))))
(let-macro ((guard1 (x) `(cut (guard ,x) 0 2)))
(test= '(true 42) (guard1 42))
(test= '(false foo) (guard1 (error "foo")))
(test= '(false foo) (guard1 (do (error "foo") (error "baz"))))
(test= '(false baz) (guard1 (do (guard1 (error "foo")) (error "baz"))))
(test= '(true 42) (guard1 (if true 42 (error "baz"))))
(test= '(false baz) (guard1 (if false 42 (error "baz"))))))

(define-test let
(let a 10
Expand Down

0 comments on commit e30be7c

Please sign in to comment.