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): demonstrate bug in the :S m...



details:   https://anonhg.NetBSD.org/src/rev/d3732753eb87
branches:  trunk
changeset: 936386:d3732753eb87
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 26 12:18:11 2020 +0000

description:
make(1): demonstrate bug in the :S modifier with the 1 modifier

The bug has been introduced in var.c r1.268 on 2020-07-19.

diffstat:

 usr.bin/make/unit-tests/modmisc.mk |  23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r 2d646e1ca927 -r d3732753eb87 usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk        Sun Jul 26 11:39:55 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk        Sun Jul 26 12:18:11 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.23 2020/07/26 11:39:55 rillig Exp $
+# $Id: modmisc.mk,v 1.24 2020/07/26 12:18:11 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -72,6 +72,27 @@
        @echo C:${:U:C,^$,empty,}
        @echo @:${:U:@var@empty@}
 
+WORDS=         sequences of letters
+# FIXME: The "*" in "letters" must not be substituted because of the 1.
+.if ${WORDS:S,e,*,1} != "s*quences of l*tters"
+.warning ${WORDS:S,e,*,1}
+.endif
+.if ${WORDS:S,e,*,} != "s*quences of l*tters"
+.error oops
+.endif
+.if ${WORDS:S,e,*,g} != "s*qu*nc*s of l*tt*rs"
+.error oops
+.endif
+.if ${WORDS:S,^sequ,occurr,} != "occurrences of letters"
+.error oops
+.endif
+.if ${WORDS:S,^of,with,} != "sequences with letters"
+.error oops
+.endif
+.if ${WORDS:S,^office,does not match,} != ${WORDS}
+.error oops
+.endif
+
 mod-subst:
        @echo $@:
        @echo :${:Ua b b c:S,a b,,:Q}:



Home | Main Index | Thread Index | Old Index