20 |
;; These tests are in a module so that the syntax transformer does not |
;; These tests are in a module so that the syntax transformer does not |
21 |
;; affect code outside of this file. |
;; affect code outside of this file. |
22 |
;; |
;; |
23 |
(define-module (syncase-test)) |
(define-module (test-suite test-syncase) |
24 |
|
:use-module (test-suite lib)) |
|
(use-modules (test-suite lib)) |
|
25 |
|
|
26 |
(pass-if "(ice-9 syncase) loads" |
(pass-if "(ice-9 syncase) loads" |
27 |
(false-if-exception |
(false-if-exception |
28 |
(begin (eval '(use-syntax (ice-9 syncase)) (current-module)) |
(begin (eval '(use-syntax (ice-9 syncase)) (current-module)) |
29 |
#t))) |
#t))) |
30 |
|
|
31 |
(define-syntax plus |
(define-syntax plus |
32 |
(syntax-rules () |
(syntax-rules () |
33 |
((plus x ...) (+ x ...)))) |
((plus x ...) (+ x ...)))) |
34 |
|
|
35 |
(pass-if "basic syncase macro" |
(pass-if "basic syncase macro" |
36 |
(= (plus 1 2 3) (+ 1 2 3))) |
(= (plus 1 2 3) (+ 1 2 3))) |