From 68bdd4196bf5521747e135c55dd90fd027d361c6 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 4 Apr 2016 15:13:46 -0700 Subject: [PATCH] strings.parser: adding error tests. --- core/strings/parser/parser-tests.factor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/strings/parser/parser-tests.factor b/core/strings/parser/parser-tests.factor index 6e29b65976..f7fcef1a29 100644 --- a/core/strings/parser/parser-tests.factor +++ b/core/strings/parser/parser-tests.factor @@ -1,4 +1,4 @@ -USING: eval strings.parser tools.test ; +USING: accessors kernel eval strings.parser tools.test ; { "Hello\n\rworld" } [ "Hello\\n\\rworld" unescape-string ] unit-test @@ -14,6 +14,9 @@ USING: eval strings.parser tools.test ; { "foobarbaz" } [ "\"foo\\\nbar\\\r\nbaz\"" eval( -- obj ) ] unit-test { "\"abc\"" } [ "\"\\\"abc\\\"\"" eval( -- string ) ] unit-test +[ "\"" eval( -- string ) ] [ error>> "Unterminated string" = ] must-fail-with +[ "\"abc" eval( -- string ) ] [ error>> "Unterminated string" = ] must-fail-with +[ "\"abc\n\n" eval( -- string ) ] [ error>> "Unterminated string" = ] must-fail-with { "\"\\" } [ "\"\\" ] unit-test