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 another test case for t...



details:   https://anonhg.NetBSD.org/src/rev/97b9cf9a9c6a
branches:  trunk
changeset: 945604:97b9cf9a9c6a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 01 22:28:52 2020 +0000

description:
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.

diffstat:

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

diffs (43 lines):

diff -r 56957dc815f6 -r 97b9cf9a9c6a usr.bin/make/unit-tests/varmod-sysv.exp
--- a/usr.bin/make/unit-tests/varmod-sysv.exp   Sun Nov 01 22:28:32 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-sysv.exp   Sun Nov 01 22:28:52 2020 +0000
@@ -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
diff -r 56957dc815f6 -r 97b9cf9a9c6a usr.bin/make/unit-tests/varmod-sysv.mk
--- a/usr.bin/make/unit-tests/varmod-sysv.mk    Sun Nov 01 22:28:32 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-sysv.mk    Sun Nov 01 22:28:52 2020 +0000
@@ -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.



Home | Main Index | Thread Index | Old Index