add minimal ?@, ?? tests to racket-test-core

This commit is contained in:
Ryan Culpepper 2018-03-28 10:25:36 +02:00
parent f4ab18716b
commit a486d05bef

View File

@ -2622,6 +2622,30 @@
[(_ () (_app cons one . _))
(equal? (syntax-line #'cons) (syntax-line #'one))])))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Minimal tests for syntax and ?@, ??
;; More tests in pkgs/racket-test/tests/stxparse/test-syntax.rkt
(test '(a 1 b 2 c 3)
'syntax
(with-syntax ([(x ...) #'(a b c)] [(y ...) #'(1 2 3)])
(syntax->datum #'((?@ x y) ...))))
(test '(1 2 3 4)
'syntax
(with-syntax ([xs #'(2 3)])
(syntax->datum #'(1 (?@ . xs) 4))))
(test '(1 2 3)
'syntax
(with-syntax ([x #'(1 2 3)])
(syntax->datum #'(?? x "missing"))))
(test '(4 5 6)
'syntax
(with-syntax ([(x ...) #'(4 5 6)])
(syntax->datum #'((?? x) ...))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)