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 unknown modifi...



details:   https://anonhg.NetBSD.org/src/rev/eaf186fdf2e9
branches:  trunk
changeset: 978834:eaf186fdf2e9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Dec 05 18:13:44 2020 +0000

description:
make(1): add test for unknown modifier in :C modifier replacement

diffstat:

 usr.bin/make/unit-tests/varmod-subst-regex.exp |  2 ++
 usr.bin/make/unit-tests/varmod-subst-regex.mk  |  7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 27c4de574657 -r eaf186fdf2e9 usr.bin/make/unit-tests/varmod-subst-regex.exp
--- a/usr.bin/make/unit-tests/varmod-subst-regex.exp    Sat Dec 05 17:46:41 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-subst-regex.exp    Sat Dec 05 18:13:44 2020 +0000
@@ -20,4 +20,6 @@
 mod-regex-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest
 make: Regex compilation error: (details omitted)
 mod-regex-errors:
+make: Unknown modifier 'Z'
+mod-regex-errors: xy
 exit status 0
diff -r 27c4de574657 -r eaf186fdf2e9 usr.bin/make/unit-tests/varmod-subst-regex.mk
--- a/usr.bin/make/unit-tests/varmod-subst-regex.mk     Sat Dec 05 17:46:41 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-subst-regex.mk     Sat Dec 05 18:13:44 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-subst-regex.mk,v 1.5 2020/10/31 12:20:36 rillig Exp $
+# $NetBSD: varmod-subst-regex.mk,v 1.6 2020/12/05 18:13:44 rillig Exp $
 #
 # Tests for the :C,from,to, variable modifier.
 
@@ -102,3 +102,8 @@
 
 mod-regex-errors:
        @echo $@: ${UNDEF:Uvalue:C,[,,}
+
+       # If the replacement pattern produces a parse error because of an
+       # unknown modifier, the parse error is ignored in ParseModifierPart
+       # and the faulty variable expression expands to "".
+       @echo $@: ${word:L:C,.*,x${:U:Z}y,W}



Home | Main Index | Thread Index | Old Index