Module Name:    src
Committed By:   rillig
Date:           Tue Dec  1 20:15:23 UTC 2020

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

Log Message:
make(1): add test for parse errors in variable name in Var_SetWithFlags


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/varparse-errors.exp \
    src/usr.bin/make/unit-tests/varparse-errors.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/varparse-errors.exp
diff -u src/usr.bin/make/unit-tests/varparse-errors.exp:1.1 src/usr.bin/make/unit-tests/varparse-errors.exp:1.2
--- src/usr.bin/make/unit-tests/varparse-errors.exp:1.1	Sun Nov  8 16:44:47 2020
+++ src/usr.bin/make/unit-tests/varparse-errors.exp	Tue Dec  1 20:15:23 2020
@@ -1 +1,3 @@
+make: Unknown modifier 'Z'
+make: Unknown modifier 'Z'
 exit status 0
Index: src/usr.bin/make/unit-tests/varparse-errors.mk
diff -u src/usr.bin/make/unit-tests/varparse-errors.mk:1.1 src/usr.bin/make/unit-tests/varparse-errors.mk:1.2
--- src/usr.bin/make/unit-tests/varparse-errors.mk:1.1	Sun Nov  8 16:44:47 2020
+++ src/usr.bin/make/unit-tests/varparse-errors.mk	Tue Dec  1 20:15:23 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varparse-errors.mk,v 1.1 2020/11/08 16:44:47 rillig Exp $
+# $NetBSD: varparse-errors.mk,v 1.2 2020/12/01 20:15:23 rillig Exp $
 
 # Tests for parsing and evaluating all kinds of variable expressions.
 #
@@ -32,4 +32,16 @@ ERR_EVAL=	An evaluation error ${:Uvalue:
 .  error
 .endif
 
+# As of 2020-12-01, errors in the variable name are silently ignored.
+VAR.${:U:Z}=	unknown modifier in the variable name
+.if ${VAR.} != "unknown modifier in the variable name"
+.  error
+.endif
+
+# As of 2020-12-01, errors in the variable name are silently ignored.
+VAR.${:U:Z}post=	unknown modifier with text in the variable name
+.if ${VAR.post} != "unknown modifier with text in the variable name"
+.  error
+.endif
+
 all:

Reply via email to