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 tests for the :S and :C...



details:   https://anonhg.NetBSD.org/src/rev/32b0edfff22b
branches:  trunk
changeset: 935508:32b0edfff22b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 04 09:21:30 2020 +0000

description:
make(1): add tests for the :S and :C modifiers

diffstat:

 usr.bin/make/unit-tests/modmisc.exp |  13 +++++++++++++
 usr.bin/make/unit-tests/modmisc.mk  |  18 +++++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletions(-)

diffs (57 lines):

diff -r d748a02a3af4 -r 32b0edfff22b usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp       Sat Jul 04 09:03:54 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp       Sat Jul 04 09:21:30 2020 +0000
@@ -17,4 +17,17 @@
 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
diff -r d748a02a3af4 -r 32b0edfff22b usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk        Sat Jul 04 09:03:54 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk        Sat Jul 04 09:21:30 2020 +0000
@@ -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_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 @@
        @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}:



Home | Main Index | Thread Index | Old Index