Added tests for unterminated strings
authorLukas Krickl <lukas@krickl.dev>
Sat, 18 Nov 2023 05:37:11 +0000 (06:37 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sat, 18 Nov 2023 05:37:11 +0000 (06:37 +0100)
src/test.c

index 9b8d07e92a865baaa754def48715bba64c5fd0b1..ce9d929c946cee431847e791f81f98167fe56f80 100644 (file)
@@ -184,8 +184,10 @@ void test_totok(void) {
 
   // string token
   ASSERT_STR_TOTOK("test", 0, "\"test\"");
-
+  // string with escape
   ASSERT_STR_TOTOK("test\n\"123\"", 0, "\"test\\n\\\"123\\\"\"");
+  // unterminated string
+  ASSERT_STR_TOTOK("test\n\"123\"", -1, "\"test\\n\\\"123\\\"");
 
   TESTEND("totok");
 }