Sun Jul 26 21:09:49 2020 UTC ()
make(1): add test for unclosed variables


(rillig)
diff -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmisc.exp
diff -r1.15 -r1.16 src/usr.bin/make/unit-tests/varmisc.mk

cvs diff -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmisc.exp (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/varmisc.exp 2020/07/26 20:30:42 1.11
+++ src/usr.bin/make/unit-tests/varmisc.exp 2020/07/26 21:09:49 1.12
@@ -44,4 +44,10 @@
 export-appended: env
 export-appended: env mk
 parse-dynamic: parse-dynamic parse-dynamic before
+varerror-unclosed:begin
+
+make: Unclosed variable specification (expecting '}') for "UNCLOSED" (value "") modifier M
+
+
+varerror-unclosed:end
 exit status 0

cvs diff -r1.15 -r1.16 src/usr.bin/make/unit-tests/varmisc.mk (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/varmisc.mk 2020/07/26 20:30:42 1.15
+++ src/usr.bin/make/unit-tests/varmisc.mk 2020/07/26 21:09:49 1.16
@@ -1,4 +1,4 @@
-# $Id: varmisc.mk,v 1.15 2020/07/26 20:30:42 rillig Exp $
+# $Id: varmisc.mk,v 1.16 2020/07/26 21:09:49 rillig Exp $
 #
 # Miscellaneous variable tests.
 
@@ -7,6 +7,7 @@
 all: save-dollars
 all: export-appended
 all: parse-dynamic
+all: varerror-unclosed
 
 unmatched_var_paren:
 	@echo ${foo::=foo-text}
@@ -174,3 +175,12 @@
 
 parse-dynamic:
 	@echo $@: ${G_TARGET} ${G_MEMBER} ${G_PREFIX} ${G_ARCHIVE} ${G_ALLSRC}
+
+# As of 2020-07-26, make does not complain about unclosed variables.
+# It does complain about unclosed variables when parsing modifiers though.
+varerror-unclosed:
+	@echo $@:begin
+	@echo ${UNCLOSED
+	@echo ${UNCLOSED:M${PATTERN
+	@echo ${UNCLOSED.${param
+	@echo $@:end