Sun Jul 19 15:16:22 2020 UTC ()
make(1): add test for stray dollar signs in :@ modifier


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

cvs diff -r1.14 -r1.15 src/usr.bin/make/unit-tests/modmisc.exp (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/modmisc.exp 2020/07/04 22:17:09 1.14
+++ src/usr.bin/make/unit-tests/modmisc.exp 2020/07/19 15:16:22 1.15
@@ -32,6 +32,9 @@
 :x__ 3 x__ 3:
 :+one+ +two+ +three+:
 mod-at-resolve:w1d2d3w w2i3w w1i2d3 2i${RES3}w w1d2d3 2i${RES3} 1i${RES2}w:
+mod-at-dollar:(1) (2) (3).
+mod-at-dollar:(1) (2) (3).
+mod-at-dollar:() () ().
 mod-subst-dollar:$1:
 mod-subst-dollar:$2:
 mod-subst-dollar:$3:

cvs diff -r1.12 -r1.13 src/usr.bin/make/unit-tests/modmisc.mk (expand / switch to context diff)
--- src/usr.bin/make/unit-tests/modmisc.mk 2020/07/04 18:54:18 1.12
+++ src/usr.bin/make/unit-tests/modmisc.mk 2020/07/19 15:16:22 1.13
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.12 2020/07/04 18:54:18 rillig Exp $
+# $Id: modmisc.mk,v 1.13 2020/07/19 15:16:22 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -16,7 +16,7 @@
 MOD_SEP=S,:, ,g
 
 all:	modvar modvarloop modsysv mod-HTE emptyvar undefvar
-all:	mod-S mod-C mod-at-varname mod-at-resolve
+all:	mod-S mod-C mod-at-varname mod-at-resolve mod-at-dollar
 all:	mod-subst-dollar mod-loop-dollar
 
 modsysv:
@@ -94,6 +94,14 @@
 
 mod-at-resolve:
 	@echo $@:${RESOLVE:@v@w${v}w@:Q}:
+
+# As of 2020-07-19, the variable name of the :@ modifier may end with one
+# or two dollar signs, which are silently ignored.  There's no point in
+# allowing a dollar sign in that position.
+mod-at-dollar:
+	@echo $@:${1 2 3:L:@v$@($v)@:Q}.
+	@echo $@:${1 2 3:L:@v$$@($v)@:Q}.
+	@echo $@:${1 2 3:L:@v$$$@($v)@:Q}.
 
 # No matter how many dollar characters there are, they all get merged
 # into a single dollar by the :S modifier.