mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +02:00
Fix `reader.test'.
This is a followup to a4e4722944
("need
read error for extra closing square brackets".)
* test-suite/tests/reader.test (exception:unexpected-rsqbracket): New
variable.
("reading")["paren mismatch (2)"]: Change exception type to
EXCEPTION:UNEXPECTED-RSQBRACKET.
["paren mismatch (3)", "paren mismatch (4)"]: New tests.
("mismatching parentheses")["closing square bracket following
mismatched opening"]: New test.
This commit is contained in:
parent
253f26085e
commit
289c3a6112
1 changed files with 14 additions and 3 deletions
|
@ -26,6 +26,8 @@
|
|||
(cons 'read-error "end of file$"))
|
||||
(define exception:unexpected-rparen
|
||||
(cons 'read-error "unexpected \")\"$"))
|
||||
(define exception:unexpected-rsqbracket
|
||||
(cons 'read-error "unexpected \"]\"$"))
|
||||
(define exception:unterminated-block-comment
|
||||
(cons 'read-error "unterminated `#. \\.\\.\\. .#' comment$"))
|
||||
(define exception:unknown-character-name
|
||||
|
@ -135,12 +137,18 @@
|
|||
|
||||
(pass-if "square brackets are parens"
|
||||
(equal? '() (read-string "[]")))
|
||||
|
||||
|
||||
(pass-if-exception "paren mismatch" exception:unexpected-rparen
|
||||
(read-string "'[)"))
|
||||
|
||||
(pass-if-exception "paren mismatch (2)" exception:mismatched-paren
|
||||
(read-string "'(]")))
|
||||
(pass-if-exception "paren mismatch (2)" exception:unexpected-rsqbracket
|
||||
(read-string "'(]"))
|
||||
|
||||
(pass-if-exception "paren mismatch (3)" exception:mismatched-paren
|
||||
(read-string "'(foo bar]"))
|
||||
|
||||
(pass-if-exception "paren mismatch (4)" exception:mismatched-paren
|
||||
(read-string "'[foo bar)")))
|
||||
|
||||
|
||||
|
||||
|
@ -159,6 +167,9 @@
|
|||
(pass-if-exception "closing parenthesis following mismatched opening"
|
||||
exception:unexpected-rparen
|
||||
(read-string ")"))
|
||||
(pass-if-exception "closing square bracket following mismatched opening"
|
||||
exception:unexpected-rsqbracket
|
||||
(read-string "]"))
|
||||
(pass-if-exception "opening vector parenthesis"
|
||||
exception:eof
|
||||
(read-string "#("))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue