diff --git a/lib/Minilisp.pm b/lib/Minilisp.pm index a5d042f..4186e56 100644 --- a/lib/Minilisp.pm +++ b/lib/Minilisp.pm @@ -75,7 +75,7 @@ sub tokenize { value => $1, }; } - elsif($str =~ s/^"(([^"\\]|\\.)+)"//) + elsif($str =~ s/^"(([^"\\]|\\.)*)"//) { $debug->("String '$1'"); my $value = $1; diff --git a/t/strings.t b/t/strings.t index 9533044..9714cae 100644 --- a/t/strings.t +++ b/t/strings.t @@ -1,7 +1,9 @@ -(plan 4) +(plan 5) (expect "length of string" (= (length "hello") 5)) +(expect "empty strings" (= (length "") 0)) + (expect "string-upcase" (string= (string-upcase "helLo") "HELLO")) (expect "string-downcase" (string= (string-downcase "HEllO") "hello"))