Module Name: src
Committed By: rillig
Date: Fri Dec 3 18:43:52 UTC 2021
Modified Files:
src/usr.bin/make/unit-tests: varname-dot-make-save_dollars.mk
Log Message:
tests/make: document .MAKE.SAVE_DOLLARS in modifier ':@'
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.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/varname-dot-make-save_dollars.mk
diff -u src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.6 src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.7
--- src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk:1.6 Thu Dec 2 22:41:01 2021
+++ src/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk Fri Dec 3 18:43:52 2021
@@ -1,4 +1,4 @@
-# $NetBSD: varname-dot-make-save_dollars.mk,v 1.6 2021/12/02 22:41:01 rillig Exp $
+# $NetBSD: varname-dot-make-save_dollars.mk,v 1.7 2021/12/03 18:43:52 rillig Exp $
#
# Tests for the special .MAKE.SAVE_DOLLARS variable, which controls whether
# the assignment operator ':=' converts '$$' to a single '$' or keeps it
@@ -108,4 +108,23 @@ VAR:= ${CMD:sh}
. error
.endif
+
+# In the modifier ':@var@body@', .MAKE.SAVE_DOLLARS does not affect the body.
+# In both cases, each '$$' is replaced with a single '$', no matter whether
+# directly or indirectly via another expression.
+.MAKE.SAVE_DOLLARS= no
+DOLLARS= $$$$$$$$
+VAR:= ${word:L:@word@$$$$$$$$-${DOLLARS}@}
+.if ${VAR} != "\$\$-\$\$"
+. error
+.endif
+
+.MAKE.SAVE_DOLLARS= yes
+DOLLARS= $$$$$$$$
+VAR:= ${word:L:@word@$$$$$$$$-${DOLLARS}@}
+.if ${VAR} != "\$\$-\$\$"
+. error
+.endif
+
+
all: