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 variable modif...



details:   https://anonhg.NetBSD.org/src/rev/92086351b920
branches:  trunk
changeset: 944540:92086351b920
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 03 12:26:11 2020 +0000

description:
make(1): add test for variable modifiers without delimiter

diffstat:

 usr.bin/make/unit-tests/opt-debug-lint.exp |   1 +
 usr.bin/make/unit-tests/opt-debug-lint.mk  |  14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r 17e7bae36547 -r 92086351b920 usr.bin/make/unit-tests/opt-debug-lint.exp
--- a/usr.bin/make/unit-tests/opt-debug-lint.exp        Sat Oct 03 10:42:08 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-lint.exp        Sat Oct 03 12:26:11 2020 +0000
@@ -1,5 +1,6 @@
 make: "opt-debug-lint.mk" line 19: Variable "X" is undefined
 make: "opt-debug-lint.mk" line 41: Variable "UNDEF" is undefined
+make: Unknown modifier '$'
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r 17e7bae36547 -r 92086351b920 usr.bin/make/unit-tests/opt-debug-lint.mk
--- a/usr.bin/make/unit-tests/opt-debug-lint.mk Sat Oct 03 10:42:08 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-lint.mk Sat Oct 03 12:26:11 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-lint.mk,v 1.7 2020/09/14 21:55:53 rillig Exp $
+# $NetBSD: opt-debug-lint.mk,v 1.8 2020/10/03 12:26:11 rillig Exp $
 #
 # Tests for the -dL command line option, which runs additional checks
 # to catch common mistakes, such as unclosed variable expressions.
@@ -56,5 +56,17 @@
 .  error
 .endif
 
+# Since 2020-10-03, in lint mode the variable modifier must be separated
+# by colons.  See varparse-mod.mk.
+.if ${value:LPL} != "value"
+.  error
+.endif
+
+# Since 2020-10-03, in lint mode the variable modifier must be separated
+# by colons.  See varparse-mod.mk.
+.if ${value:${:UL}PL} != "LPL}"                # FIXME: "LPL}" is unexpected here.
+.  error ${value:${:UL}PL}
+.endif
+
 all:
        @:;



Home | Main Index | Thread Index | Old Index