Skip to content

Commit

Permalink
add disabled/faling unit tests #43
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Mar 1, 2021
1 parent 44a4ec5 commit 6a3de53
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -937,3 +937,40 @@
(t.is (let*-values (((a b c) (values 1 2 3)))
(+ a b c))
6)))

(test_ "syntax: nested _"
(lambda (t)
(define-syntax foo
(syntax-rules ()
((_)
(let ()
(define-syntax %foo
(syntax-rules (foo bar)
((_ (foo))
"foo")
((_) "bar")
((_ x)
'x)))
(list (%foo (foo))
(%foo (10))
(%foo bar)
(%foo))))))

(t.is (foo) '("foo" (10) bar "bar"))))

(test_ "syntax: nesting, renaming and scope"
(lambda (t)
(let ((result 10))
(define-syntax foo
(syntax-rules ()
((_)
(let ()
(define-syntax %foo
(syntax-rules (foo bar)
((__ (foo))
(set! result '(foo)))
((__ x)
(set! result 'x))))
(%foo (foo))))))
(foo)
(t.is result '(foo)))))

0 comments on commit 6a3de53

Please sign in to comment.