Module Name:    src
Committed By:   rillig
Date:           Mon Nov  2 17:30:22 UTC 2020

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod.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/varmod.exp
diff -u src/usr.bin/make/unit-tests/varmod.exp:1.2 src/usr.bin/make/unit-tests/varmod.exp:1.3
--- src/usr.bin/make/unit-tests/varmod.exp:1.2	Sun Sep 13 07:42:20 2020
+++ src/usr.bin/make/unit-tests/varmod.exp	Mon Nov  2 17:30:22 2020
@@ -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

Index: src/usr.bin/make/unit-tests/varmod.mk
diff -u src/usr.bin/make/unit-tests/varmod.mk:1.3 src/usr.bin/make/unit-tests/varmod.mk:1.4
--- src/usr.bin/make/unit-tests/varmod.mk:1.3	Sun Sep 13 07:42:20 2020
+++ src/usr.bin/make/unit-tests/varmod.mk	Mon Nov  2 17:30:22 2020
@@ -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 @@ DOLLAR2=	${:U\$}
 .  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

Reply via email to