add minimal ?@, ?? tests to racket-test-core
This commit is contained in:
parent
f4ab18716b
commit
a486d05bef
|
@ -2622,6 +2622,30 @@
|
||||||
[(_ () (_app cons one . _))
|
[(_ () (_app cons one . _))
|
||||||
(equal? (syntax-line #'cons) (syntax-line #'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)
|
(report-errs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user