syntax/parse: change test to use eval so no error logged when compiled

This commit is contained in:
Ryan Culpepper 2016-07-14 14:30:44 -04:00
parent 521ff7cc67
commit 19707a54be
2 changed files with 19 additions and 12 deletions

View File

@ -1,4 +1,3 @@
#lang info
(define test-responsibles '((all ryanc)))
(define compile-omit-files '("test.rkt"))

View File

@ -647,17 +647,25 @@
(tok (1 . (2 3)) (~datum (1 . (2 3))) 'ok)
;; nullable EH pattern raises error on match (rather than diverging) (7/2016)
(tcerr "nullable"
(syntax-parse #'(1 2 3)
[((~seq) ... n:nat ...) 'ok])
#rx"nullable ellipsis-head pattern|ellipsis-head pattern matched an empty sequence")
(tcerr "nullable (dynamic)"
(let ()
(define-splicing-syntax-class empty
(pattern (~seq)))
(syntax-parse #'(1 2 3)
[((~seq e:empty) ... n:nat ...) 'ok]))
#rx"ellipsis-head pattern matched an empty sequence")
(let ()
;; to make drdr happy: use eval because compiling this code currently logs an error
(define ns (make-base-namespace))
(eval '(require syntax/parse) ns)
(tcerr "nullable"
(eval
'(syntax-parse #'(1 2 3)
[((~seq) ... n:nat ...) 'ok])
ns)
#rx"nullable ellipsis-head pattern|ellipsis-head pattern matched an empty sequence")
(tcerr "nullable (dynamic)"
(eval
'(let ()
(define-splicing-syntax-class empty
(pattern (~seq)))
(syntax-parse #'(1 2 3)
[((~seq e:empty) ... n:nat ...) 'ok]))
ns)
#rx"ellipsis-head pattern matched an empty sequence"))
;; nullable but bounded EH pattern ok (thanks Alex Knauth) (7/2016)
(tok (1 2 3) ((~once (~seq)) ... n:nat ...) 'ok)