From 289c3a6112171a2c951f92825e8f2dc8c080d642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 7 Nov 2010 23:31:53 +0100 Subject: [PATCH] Fix `reader.test'. This is a followup to a4e472294423bb796db3132c73027384fdfff820 ("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. --- test-suite/tests/reader.test | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test index 0027da7bf..6f0ed1d59 100644 --- a/test-suite/tests/reader.test +++ b/test-suite/tests/reader.test @@ -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 "#("))