diff --git a/tests/r7rs-tests.scm b/tests/r7rs-tests.scm index 1c9aecc8..74c734af 100644 --- a/tests/r7rs-tests.scm +++ b/tests/r7rs-tests.scm @@ -439,6 +439,26 @@ (be-like-begin3 sequence3) (test 5 (sequence3 2 3 4 5)) +;; underscore +(define-syntax count-to-2 + (syntax-rules () + ((_) 0) + ((_ _) 1) + ((_ _ _) 2) + ((_ . _) 'many))) +(test '(2 0 many) + (list (count-to-2 a b) (count-to-2) (count-to-2 a b c d))) + +(define-syntax count-to-2_ + (syntax-rules (_) + ((_) 0) + ((_ _) 1) + ((_ _ _) 2) + ((x . y) 'fail))) +(test '(2 0 fail fail) + (list (count-to-2_ _ _) (count-to-2_) + (count-to-2_ a b) (count-to-2_ a b c d))) + (define-syntax jabberwocky (syntax-rules () ((_ hatter)