Add more tests for escaped newline handling and fix a test that currently

should fail because of a bug in the parser (test 2).
This commit is contained in:
harti 2005-10-18 07:20:14 +00:00
parent 8fa362e399
commit 2733c20457
14 changed files with 48 additions and 8 deletions

View File

@ -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

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
0

View File

@ -1,2 +0,0 @@
"Makefile", line 23: Unassociated shell command "@echo ok"
make: fatal errors encountered -- cannot continue

View File

@ -0,0 +1,2 @@
a
b

View File

@ -0,0 +1 @@
a b

View File

@ -0,0 +1 @@
a b

View File

@ -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 $*