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 test for double expansi...



details:   https://anonhg.NetBSD.org/src/rev/9e2ce7c67131
branches:  trunk
changeset: 944677:9e2ce7c67131
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Oct 06 21:19:17 2020 +0000

description:
make(1): add test for double expansion in SySV modifier

diffstat:

 usr.bin/make/unit-tests/varmod-sysv.mk |  14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r 3210925ba98f -r 9e2ce7c67131 usr.bin/make/unit-tests/varmod-sysv.mk
--- a/usr.bin/make/unit-tests/varmod-sysv.mk    Tue Oct 06 21:05:21 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-sysv.mk    Tue Oct 06 21:19:17 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-sysv.mk,v 1.4 2020/10/06 21:05:21 rillig Exp $
+# $NetBSD: varmod-sysv.mk,v 1.5 2020/10/06 21:19:17 rillig Exp $
 #
 # Tests for the ${VAR:from=to} variable modifier, which replaces the suffix
 # "from" with "to".  It can also use '%' as a wildcard.
@@ -88,3 +88,15 @@
 .if ${LIST:%nes=%xxx} != "one two" # lhs is longer than the word "one"
 .  error
 .endif
+
+# As of 2020-10-06, the right-hand side of the SysV modifier is expanded
+# twice.  The first expansion happens in ApplyModifier_SysV, where the
+# modifier is split into its two parts.  The second expansion happens
+# when each word is replaced in ModifyWord_SYSVSubst.
+# XXX: This is unexpected.  Add more test case to demonstrate the effects
+# of removing one of the expansions.
+VALUE=         value
+INDIRECT=      1:${VALUE} 2:$${VALUE} 4:$$$${VALUE}
+.if ${x:L:x=${INDIRECT}} != "1:value 2:value 4:\${VALUE}"
+.  error
+.endif



Home | Main Index | Thread Index | Old Index