Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): add test for parse errors i...



details:   https://anonhg.NetBSD.org/src/rev/e13ca8ae4ee8
branches:  trunk
changeset: 946575:e13ca8ae4ee8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 01 20:15:23 2020 +0000

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

diffstat:

 usr.bin/make/unit-tests/varparse-errors.exp |   2 ++
 usr.bin/make/unit-tests/varparse-errors.mk  |  14 +++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r eb76685992ae -r e13ca8ae4ee8 usr.bin/make/unit-tests/varparse-errors.exp
--- a/usr.bin/make/unit-tests/varparse-errors.exp       Tue Dec 01 19:37:23 2020 +0000
+++ b/usr.bin/make/unit-tests/varparse-errors.exp       Tue Dec 01 20:15:23 2020 +0000
@@ -1,1 +1,3 @@
+make: Unknown modifier 'Z'
+make: Unknown modifier 'Z'
 exit status 0
diff -r eb76685992ae -r e13ca8ae4ee8 usr.bin/make/unit-tests/varparse-errors.mk
--- a/usr.bin/make/unit-tests/varparse-errors.mk        Tue Dec 01 19:37:23 2020 +0000
+++ b/usr.bin/make/unit-tests/varparse-errors.mk        Tue Dec 01 20:15:23 2020 +0000
@@ -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 @@
 .  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:



Home | Main Index | Thread Index | Old Index