]> gitweb.factorcode.org Git - factor.git/commitdiff
strings.parser: adding error tests.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 4 Apr 2016 22:13:46 +0000 (15:13 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 4 Apr 2016 22:13:46 +0000 (15:13 -0700)
core/strings/parser/parser-tests.factor

index 6e29b659762c9f4ec3364d6892f499cc39c40bb8..f7fcef1a291ca613daa48c9d67c9e6091728a2b6 100644 (file)
@@ -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