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 the :P modifie...



details:   https://anonhg.NetBSD.org/src/rev/9a78d0352fc1
branches:  trunk
changeset: 1015867:9a78d0352fc1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 02 17:30:22 2020 +0000

description:
make(1): add test for the :P modifier, which does not fall back

diffstat:

 usr.bin/make/unit-tests/varmod.exp |   2 ++
 usr.bin/make/unit-tests/varmod.mk  |  11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r db99b2a98016 -r 9a78d0352fc1 usr.bin/make/unit-tests/varmod.exp
--- a/usr.bin/make/unit-tests/varmod.exp        Mon Nov 02 17:00:33 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod.exp        Mon Nov 02 17:30:22 2020 +0000
@@ -1,6 +1,8 @@
 make: "varmod.mk" line 42: To escape a dollar, use \$, not $$, at "$$:L} != """
 make: "varmod.mk" line 42: Invalid variable name ':', at "$:L} != """
 make: "varmod.mk" line 47: Dollar followed by nothing
+make: "varmod.mk" line 56: Missing delimiter ':' after modifier "P"
+make: "varmod.mk" line 57: Unknown directive "error"
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r db99b2a98016 -r 9a78d0352fc1 usr.bin/make/unit-tests/varmod.mk
--- a/usr.bin/make/unit-tests/varmod.mk Mon Nov 02 17:00:33 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod.mk Mon Nov 02 17:30:22 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod.mk,v 1.3 2020/09/13 07:42:20 rillig Exp $
+# $NetBSD: varmod.mk,v 1.4 2020/11/02 17:30:22 rillig Exp $
 #
 # Tests for variable modifiers, such as :Q, :S,from,to or :Ufallback.
 
@@ -48,4 +48,13 @@
 .  error
 .endif
 
+# The variable modifier :P does not fall back to the SysV modifier.
+# Therefore the modifier :P=RE generates a parse error.
+# XXX: The .error should not be reached since the variable expression is
+# malformed.
+VAR=   STOP
+.if ${VAR:P=RE} != "STORE"
+.  error
+.endif
+
 all: # nothing



Home | Main Index | Thread Index | Old Index