Module Name:    src
Committed By:   rillig
Date:           Sun Jul 26 12:18:12 UTC 2020

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

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/make/unit-tests/modmisc.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/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.23 src/usr.bin/make/unit-tests/modmisc.mk:1.24
--- src/usr.bin/make/unit-tests/modmisc.mk:1.23	Sun Jul 26 11:39:55 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk	Sun Jul 26 12:18:11 2020
@@ -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 @@ undefvar:
 	@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}:

Reply via email to