Module Name:    src
Committed By:   rillig
Date:           Sun Nov  1 22:28:53 UTC 2020

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

Log Message:
make(1): add another test case for the SysV modifier

The "special case" in ApplyModifier_SysV looks redundant since in
SysVMatch, the empty word does not match anything.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmod-sysv.exp
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/varmod-sysv.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-sysv.exp
diff -u src/usr.bin/make/unit-tests/varmod-sysv.exp:1.4 src/usr.bin/make/unit-tests/varmod-sysv.exp:1.5
--- src/usr.bin/make/unit-tests/varmod-sysv.exp:1.4	Sun Nov  1 22:10:57 2020
+++ src/usr.bin/make/unit-tests/varmod-sysv.exp	Sun Nov  1 22:28:52 2020
@@ -1,5 +1,5 @@
 make: Unfinished modifier for word203 ('=' missing)
-make: "varmod-sysv.mk" line 203: Malformed conditional (${word203:L:from${:D=}to})
+make: "varmod-sysv.mk" line 210: Malformed conditional (${word203:L:from${:D=}to})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/varmod-sysv.mk
diff -u src/usr.bin/make/unit-tests/varmod-sysv.mk:1.10 src/usr.bin/make/unit-tests/varmod-sysv.mk:1.11
--- src/usr.bin/make/unit-tests/varmod-sysv.mk:1.10	Sun Nov  1 22:10:57 2020
+++ src/usr.bin/make/unit-tests/varmod-sysv.mk	Sun Nov  1 22:28:52 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-sysv.mk,v 1.10 2020/11/01 22:10:57 rillig Exp $
+# $NetBSD: varmod-sysv.mk,v 1.11 2020/11/01 22:28:52 rillig Exp $
 #
 # Tests for the ${VAR:from=to} variable modifier, which replaces the suffix
 # "from" with "to".  It can also use '%' as a wildcard.
@@ -74,13 +74,20 @@
 .  error
 .endif
 
-# If the variable is empty, it is debatable whether it consists of a single
-# empty word, or no word at all.  The :from=to modifier treats it as no
-# word at all.
+# If the variable value is empty, it is debatable whether it consists of a
+# single empty word, or no word at all.  The :from=to modifier treats it as
+# no word at all.
 .if ${:L:=suffix} != ""
 .  error
 .endif
 
+# If the variable value is empty, it is debatable whether it consists of a
+# single empty word, or no word at all.  The :from=to modifier treats it as
+# no word at all.
+.if ${:L:%=suffix} != ""
+.  error
+.endif
+
 # Before 2020-07-19, an ampersand could be used in the replacement part
 # of a SysV substitution modifier, and it was replaced with the whole match,
 # just like in the :S modifier.

Reply via email to