diff options
author | harti <harti@FreeBSD.org> | 2005-10-18 07:20:14 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-10-18 07:20:14 +0000 |
commit | 2733c20457d96ed616c66973ede36dca3df80ea0 (patch) | |
tree | 9fcd8ed55a98e1485e69dc79d3c7e6f35da4a3e2 /tools/regression/usr.bin | |
parent | 8fa362e39921f18799787fc21e7fa6ee18cfc8dd (diff) | |
download | FreeBSD-src-2733c20457d96ed616c66973ede36dca3df80ea0.zip FreeBSD-src-2733c20457d96ed616c66973ede36dca3df80ea0.tar.gz |
Add more tests for escaped newline handling and fix a test that currently
should fail because of a bug in the parser (test 2).
Diffstat (limited to 'tools/regression/usr.bin')
14 files changed, 48 insertions, 8 deletions
diff --git a/tools/regression/usr.bin/make/syntax/enl/Makefile b/tools/regression/usr.bin/make/syntax/enl/Makefile index 7b37e78..a7c6955 100644 --- a/tools/regression/usr.bin/make/syntax/enl/Makefile +++ b/tools/regression/usr.bin/make/syntax/enl/Makefile @@ -14,12 +14,46 @@ test1: .elifmake test2 -# This should fail because the comment continues on the next lines leading -# to an unassociated shell command. -\ +# This should print ok because the second assignment to foo is actually +# a continued comment. +FOO=ok #\ \ +FOO=not ok test2: - @echo ok + @echo "${FOO}" + +.elifmake test3 + +# Make sure an escaped newline inserts a space +test3: a\ +b + +a: + @echo a + +b: + @echo b + +.elifmake test4 + +# Make sure an escaped newline inserts exactly one space +FOO=a\ + b + +test4: + @echo "${FOO}" + +.elifmake test5 + +# Make sure each escaped newline inserts exactly one space +FOO=a\ +\ +\ +\ +b +test5: + @echo "${FOO}" + .endif diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.2 b/tools/regression/usr.bin/make/syntax/enl/expected.status.2 index d00491f..573541a 100644 --- a/tools/regression/usr.bin/make/syntax/enl/expected.status.2 +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.2 @@ -1 +1 @@ -1 +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.3 b/tools/regression/usr.bin/make/syntax/enl/expected.status.3 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.3 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.4 b/tools/regression/usr.bin/make/syntax/enl/expected.status.4 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.4 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.status.5 b/tools/regression/usr.bin/make/syntax/enl/expected.status.5 new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.status.5 @@ -0,0 +1 @@ +0 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 index ae504f9..e69de29 100644 --- a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.2 @@ -1,2 +0,0 @@ -"Makefile", line 23: Unassociated shell command "@echo ok" -make: fatal errors encountered -- cannot continue diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.3 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.3 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.3 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.4 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.4 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.4 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stderr.5 b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.5 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stderr.5 diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 index e69de29..9766475 100644 --- a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.2 @@ -0,0 +1 @@ +ok diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.3 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.3 new file mode 100644 index 0000000..422c2b7 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.3 @@ -0,0 +1,2 @@ +a +b diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.4 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.4 new file mode 100644 index 0000000..b2901ea --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.4 @@ -0,0 +1 @@ +a b diff --git a/tools/regression/usr.bin/make/syntax/enl/expected.stdout.5 b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.5 new file mode 100644 index 0000000..5120076 --- /dev/null +++ b/tools/regression/usr.bin/make/syntax/enl/expected.stdout.5 @@ -0,0 +1 @@ +a b diff --git a/tools/regression/usr.bin/make/syntax/enl/test.t b/tools/regression/usr.bin/make/syntax/enl/test.t index de8bcfe..2e5d12c 100644 --- a/tools/regression/usr.bin/make/syntax/enl/test.t +++ b/tools/regression/usr.bin/make/syntax/enl/test.t @@ -9,7 +9,7 @@ cd `dirname $0` DESC="Test escaped new-lines handling." # Run -TEST_N=2 +TEST_N=5 TEST_2_TODO="bug in parser" eval_cmd $* |