Module Name:    src
Committed By:   rillig
Date:           Sun Jul 26 21:09:49 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: varmisc.exp varmisc.mk

Log Message:
make(1): add test for unclosed variables


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/varmisc.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/varmisc.exp
diff -u src/usr.bin/make/unit-tests/varmisc.exp:1.11 src/usr.bin/make/unit-tests/varmisc.exp:1.12
--- src/usr.bin/make/unit-tests/varmisc.exp:1.11	Sun Jul 26 20:30:42 2020
+++ src/usr.bin/make/unit-tests/varmisc.exp	Sun Jul 26 21:09:49 2020
@@ -44,4 +44,10 @@ export-appended: env
 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

Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.15 src/usr.bin/make/unit-tests/varmisc.mk:1.16
--- src/usr.bin/make/unit-tests/varmisc.mk:1.15	Sun Jul 26 20:30:42 2020
+++ src/usr.bin/make/unit-tests/varmisc.mk	Sun Jul 26 21:09:49 2020
@@ -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: unmatched_var_paren D_true U_true D
 all: save-dollars
 all: export-appended
 all: parse-dynamic
+all: varerror-unclosed
 
 unmatched_var_paren:
 	@echo ${foo::=foo-text}
@@ -174,3 +175,12 @@ ${:U>}=		after
 
 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

Reply via email to