diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-09 10:20:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-09 10:20:52 +0200 |
commit | e3b6dc455ab5c98606e38983bd19426ae346f469 (patch) | |
tree | 62f145eac81c7c6f955ca9e63df17aa07c392c11 /tests | |
parent | ccca13f8eadef31f2df873cb505ebca98501c45a (diff) |
Reimplement double quote lexing to avoid "implied quote" trick
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lexer/driver.cxx | 1 | ||||
-rw-r--r-- | tests/quote/buildfile | 4 | ||||
-rw-r--r-- | tests/quote/test.out | 3 | ||||
-rwxr-xr-x | tests/quote/test.sh | 2 |
4 files changed, 9 insertions, 1 deletions
diff --git a/tests/lexer/driver.cxx b/tests/lexer/driver.cxx index e3543da..a3819f5 100644 --- a/tests/lexer/driver.cxx +++ b/tests/lexer/driver.cxx @@ -99,6 +99,7 @@ main () assert (lex ("f\"oo$ba\"r") == tokens ({"foo", "$", "bar", ""})); assert (lex ("\"foo bar") == tokens ({"<lexer error>"})); + assert (lex ("\"foo $") == tokens ({"foo ", "$", "<lexer error>"})); assert (lex ("\"foo $bar") == tokens ({"foo ", "$", "<lexer error>"})); // Combinations. diff --git a/tests/quote/buildfile b/tests/quote/buildfile index 931bc36..6dd22b4 100644 --- a/tests/quote/buildfile +++ b/tests/quote/buildfile @@ -15,4 +15,8 @@ print "[ $bar ]" print "[ $foo $bar ]" print "[ $foo/$bar ]" +print $foo'bar' +print $foo"$bar" +print "$foo"bar + ./: diff --git a/tests/quote/test.out b/tests/quote/test.out index 802f28f..216b1c8 100644 --- a/tests/quote/test.out +++ b/tests/quote/test.out @@ -9,3 +9,6 @@ fo o bar [ bar ] [ fo o bar ] [ fo o/ bar ] +fo obar +fo o bar +fo obar diff --git a/tests/quote/test.sh b/tests/quote/test.sh index 145ea6b..b898b3c 100755 --- a/tests/quote/test.sh +++ b/tests/quote/test.sh @@ -1,3 +1,3 @@ #!/bin/sh -valgrind -q b -q | diff test.out - +valgrind -q b -q | diff -u test.out - |