From d35721f8cabc140cb247e52df1d2595d09b556b8 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 28 Apr 2019 12:07:43 +0100 Subject: [PATCH 1/2] step1: Extra tests of incorrectly-terminated strings. My initial Inform 7 implementation failed these, but passed the other one. --- tests/step1_read_print.mal | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/step1_read_print.mal b/tests/step1_read_print.mal index 51290a9a..db8193c0 100644 --- a/tests/step1_read_print.mal +++ b/tests/step1_read_print.mal @@ -90,6 +90,10 @@ false ;;; These should throw some error with no return value "abc ;/.*(EOF|end of input|unbalanced).* +" +;/.*(EOF|end of input|unbalanced).* +"\" +;/.*(EOF|end of input|unbalanced).* (1 "abc ;/.*(EOF|end of input|unbalanced).* (1 "abc" From ca89606b6345ef29110799dfaac5c846849032a7 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 9 May 2019 10:19:48 +0100 Subject: [PATCH 2/2] step1: More tests of backslashes in strings. These check that "\\" is correctly read, and also that the implementation can correctly handle a large number of backslashes in succession. --- tests/step1_read_print.mal | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/step1_read_print.mal b/tests/step1_read_print.mal index db8193c0..53fa2261 100644 --- a/tests/step1_read_print.mal +++ b/tests/step1_read_print.mal @@ -80,6 +80,10 @@ false ;;;;=>"abc\ndef" "" ;=>"" +"\\" +;=>"\\" +"\\\\\\\\\\\\\\\\\\" +;=>"\\\\\\\\\\\\\\\\\\" ;; Testing reader errors (1 2 @@ -94,6 +98,8 @@ false ;/.*(EOF|end of input|unbalanced).* "\" ;/.*(EOF|end of input|unbalanced).* +"\\\\\\\\\\\\\\\\\\\" +;/.*(EOF|end of input|unbalanced).* (1 "abc ;/.*(EOF|end of input|unbalanced).* (1 "abc"