Module Name: src
Committed By: rillig
Date: Sun Jul 26 14:39:46 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: moderrs.exp moderrs.mk
Log Message:
make(1): add tests for :!...! parse errors
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/moderrs.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/moderrs.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/moderrs.exp
diff -u src/usr.bin/make/unit-tests/moderrs.exp:1.4 src/usr.bin/make/unit-tests/moderrs.exp:1.5
--- src/usr.bin/make/unit-tests/moderrs.exp:1.4 Sun Jul 26 14:16:45 2020
+++ src/usr.bin/make/unit-tests/moderrs.exp Sun Jul 26 14:39:46 2020
@@ -26,4 +26,9 @@ make: Unclosed substitution for UNDEF (]
13=
12345=ok
+Expect: 2 errors about missing ! delimiter
+make: Unclosed substitution for VARNAME (! missing)
+
+make: Unclosed substitution for ! (! missing)
+
exit status 0
Index: src/usr.bin/make/unit-tests/moderrs.mk
diff -u src/usr.bin/make/unit-tests/moderrs.mk:1.3 src/usr.bin/make/unit-tests/moderrs.mk:1.4
--- src/usr.bin/make/unit-tests/moderrs.mk:1.3 Sun Jul 26 14:16:45 2020
+++ src/usr.bin/make/unit-tests/moderrs.mk Sun Jul 26 14:39:46 2020
@@ -1,4 +1,4 @@
-# $Id: moderrs.mk,v 1.3 2020/07/26 14:16:45 rillig Exp $
+# $Id: moderrs.mk,v 1.4 2020/07/26 14:39:46 rillig Exp $
#
# various modifier error tests
@@ -10,6 +10,7 @@ MOD_S:= ${MOD_TERM},
all: modunkn modunknV varterm vartermV modtermV modloop
all: modwords
+all: modexclam
modunkn:
@echo "Expect: Unknown modifier 'Z'"
@@ -57,3 +58,12 @@ modwords:
# This results in a range from LONG_MAX - 1 to 3,
# which is empty.
@echo 12345=${UNDEF:U1 2 3:[123451234512345123451234512345]:S,^$,ok,:S,^3$,ok,}
+
+modexclam:
+ @echo "Expect: 2 errors about missing ! delimiter"
+ @echo ${VARNAME:!echo}
+ # When the final exclamation mark is missing, there is no
+ # fallback to the SysV substitution modifier.
+ # If there were a fallback, the output would be "exclam",
+ # and the above would have produced an "Unknown modifier '!'".
+ @echo ${!:L:!=exclam}