Module Name: src Committed By: rillig Date: Sat Jul 4 09:21:30 UTC 2020
Modified Files: src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk Log Message: make(1): add tests for the :S and :C modifiers To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/modmisc.exp cvs rdiff -u -r1.7 -r1.8 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.exp diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.8 src/usr.bin/make/unit-tests/modmisc.exp:1.9 --- src/usr.bin/make/unit-tests/modmisc.exp:1.8 Fri Jul 3 22:10:42 2020 +++ src/usr.bin/make/unit-tests/modmisc.exp Sat Jul 4 09:21:30 2020 @@ -17,4 +17,17 @@ C: S:empty C:empty @: +:a b b c: +:a b b c: +: b c: +:a c: +:x__ 3 x__ 3: +:a b b c: +:a b b c: +: b c: +make: RE substitution error: repetition-operator operand invalid +make: Unclosed substitution for (, missing) +:C,word,____,:Q}: +:a c: +:x__ 3 x__ 3: exit status 0 Index: src/usr.bin/make/unit-tests/modmisc.mk diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.7 src/usr.bin/make/unit-tests/modmisc.mk:1.8 --- src/usr.bin/make/unit-tests/modmisc.mk:1.7 Fri Jul 3 22:10:42 2020 +++ src/usr.bin/make/unit-tests/modmisc.mk Sat Jul 4 09:21:30 2020 @@ -1,4 +1,4 @@ -# $Id: modmisc.mk,v 1.7 2020/07/03 22:10:42 rillig Exp $ +# $Id: modmisc.mk,v 1.8 2020/07/04 09:21:30 rillig Exp $ # # miscellaneous modifier tests @@ -16,6 +16,7 @@ MOD_OPT=@d@$${exists($$d):?$$d:$${d:S,/u MOD_SEP=S,:, ,g all: modvar modvarloop modsysv mod-HTE emptyvar undefvar +all: mod-S mod-C modsysv: @echo "The answer is ${libfoo.a:L:libfoo.a=42}" @@ -58,3 +59,18 @@ undefvar: @echo S:${:U:S,^$,empty,} @echo C:${:U:C,^$,empty,} @echo @:${:U:@var@empty@} + +mod-S: + @echo :${:Ua b b c:S,a b,,:Q}: + @echo :${:Ua b b c:S,a b,,1:Q}: + @echo :${:Ua b b c:S,a b,,W:Q}: + @echo :${:Ua b b c:S,b,,g:Q}: + @echo :${:U1 2 3 1 2 3:S,1 2,___,Wg:S,_,x,:Q}: + +mod-C: + @echo :${:Ua b b c:C,a b,,:Q}: + @echo :${:Ua b b c:C,a b,,1:Q}: + @echo :${:Ua b b c:C,a b,,W:Q}: + @echo :${:Uword1 word2:C,****,____,g:C,word,____,:Q}: + @echo :${:Ua b b c:C,b,,g:Q}: + @echo :${:U1 2 3 1 2 3:C,1 2,___,Wg:C,_,x,:Q}: