Sun Jul 19 19:36:20 2020 UTC ()
make(1): add tests for maximum number of capturing groups in :C


(rillig)
diff -r1.17 -r1.18 src/usr.bin/make/unit-tests/modmisc.exp
diff -r1.14 -r1.15 src/usr.bin/make/unit-tests/modmisc.mk

cvs diff -r1.17 -r1.18 src/usr.bin/make/unit-tests/modmisc.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/modmisc.exp 2020/07/19 19:27:08 1.17
+++ src/usr.bin/make/unit-tests/modmisc.exp 2020/07/19 19:36:20 1.18
@@ -59,14 +59,15 @@ make: No subexpression \1 @@ -59,14 +59,15 @@ make: No subexpression \1
59mod-C-limits:11-missing:1 6 59mod-C-limits:11-missing:1 6
60mod-C-limits:11-ok:1 22 446 60mod-C-limits:11-ok:1 22 446
61make: No subexpression \2 61make: No subexpression \2
62make: No subexpression \2 62make: No subexpression \2
63make: No subexpression \2 63make: No subexpression \2
64make: No subexpression \2 64make: No subexpression \2
65mod-C-limits:22-missing:1 6 65mod-C-limits:22-missing:1 6
66make: No subexpression \2 66make: No subexpression \2
67make: No subexpression \2 67make: No subexpression \2
68make: No subexpression \2 68make: No subexpression \2
69make: No subexpression \2 69make: No subexpression \2
70mod-C-limits:22-missing:1 6 70mod-C-limits:22-missing:1 6
71mod-C-limits:22-ok:1 33 556 71mod-C-limits:22-ok:1 33 556
 72mod-C-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest
72exit status 0 73exit status 0

cvs diff -r1.14 -r1.15 src/usr.bin/make/unit-tests/modmisc.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/modmisc.mk 2020/07/19 17:24:22 1.14
+++ src/usr.bin/make/unit-tests/modmisc.mk 2020/07/19 19:36:20 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $Id: modmisc.mk,v 1.14 2020/07/19 17:24:22 rillig Exp $ 1# $Id: modmisc.mk,v 1.15 2020/07/19 19:36:20 rillig Exp $
2# 2#
3# miscellaneous modifier tests 3# miscellaneous modifier tests
4 4
5# do not put any dirs in this list which exist on some 5# do not put any dirs in this list which exist on some
6# but not all target systems - an exists() check is below. 6# but not all target systems - an exists() check is below.
7path=:/bin:/tmp::/:.:/no/such/dir:. 7path=:/bin:/tmp::/:.:/no/such/dir:.
8# strip cwd from path. 8# strip cwd from path.
9MOD_NODOT=S/:/ /g:N.:ts: 9MOD_NODOT=S/:/ /g:N.:ts:
10# and decorate, note that $'s need to be doubled. Also note that  10# and decorate, note that $'s need to be doubled. Also note that
11# the modifier_variable can be used with other modifiers. 11# the modifier_variable can be used with other modifiers.
12MOD_NODOTX=S/:/ /g:N.:@d@'$$d'@ 12MOD_NODOTX=S/:/ /g:N.:@d@'$$d'@
13# another mod - pretend it is more interesting 13# another mod - pretend it is more interesting
14MOD_HOMES=S,/home/,/homes/, 14MOD_HOMES=S,/home/,/homes/,
@@ -132,13 +132,16 @@ mod-loop-dollar: @@ -132,13 +132,16 @@ mod-loop-dollar:
132 @echo $@:${:U2:@word@$${word}$$@:Q}: 132 @echo $@:${:U2:@word@$${word}$$@:Q}:
133 @echo $@:${:U3:@word@$$${word}$$$@:Q}: 133 @echo $@:${:U3:@word@$$${word}$$$@:Q}:
134 @echo $@:${:U4:@word@$$$${word}$$$$@:Q}: 134 @echo $@:${:U4:@word@$$$${word}$$$$@:Q}:
135 @echo $@:${:U5:@word@$$$$${word}$$$$$@:Q}: 135 @echo $@:${:U5:@word@$$$$${word}$$$$$@:Q}:
136 @echo $@:${:U6:@word@$$$$$${word}$$$$$$@:Q}: 136 @echo $@:${:U6:@word@$$$$$${word}$$$$$$@:Q}:
137 137
138mod-C-limits: 138mod-C-limits:
139 @echo $@:00-ok:${:U1 23 456:C,..,\0\0,:Q} 139 @echo $@:00-ok:${:U1 23 456:C,..,\0\0,:Q}
140 @echo $@:11-missing:${:U1 23 456:C,..,\1\1,:Q} 140 @echo $@:11-missing:${:U1 23 456:C,..,\1\1,:Q}
141 @echo $@:11-ok:${:U1 23 456:C,(.).,\1\1,:Q} 141 @echo $@:11-ok:${:U1 23 456:C,(.).,\1\1,:Q}
142 @echo $@:22-missing:${:U1 23 456:C,..,\2\2,:Q} 142 @echo $@:22-missing:${:U1 23 456:C,..,\2\2,:Q}
143 @echo $@:22-missing:${:U1 23 456:C,(.).,\2\2,:Q} 143 @echo $@:22-missing:${:U1 23 456:C,(.).,\2\2,:Q}
144 @echo $@:22-ok:${:U1 23 456:C,(.)(.),\2\2,:Q} 144 @echo $@:22-ok:${:U1 23 456:C,(.)(.),\2\2,:Q}
 145 # The :C modifier only handles single-digit capturing groups,
 146 # which is more than enough for daily use.
 147 @echo $@:capture:${:UabcdefghijABCDEFGHIJrest:C,(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.),\9\8\7\6\5\4\3\2\1\0\10\11\12,}