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 tests/make: extend test for undefine...



details:   https://anonhg.NetBSD.org/src/rev/2eec5164f0b6
branches:  trunk
changeset: 1025914:2eec5164f0b6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 13 19:02:07 2021 +0000

description:
tests/make: extend test for undefined variable in doubly indirect ':='

Just to prevent a half-baked fix to the current behavior that would
concatenate the modifiers of the two expressions, leading to
${LATER:value=sysv:tl} in this case.  That expression would be
interpreted as having only a single modifier that would replace the
suffix 'value' with 'sysv:tl'.  This is because the SysV modifier
':from=to' spans until the end of the expression.

diffstat:

 usr.bin/make/unit-tests/var-op-expand.mk |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 1a3e1c084f8e -r 2eec5164f0b6 usr.bin/make/unit-tests/var-op-expand.mk
--- a/usr.bin/make/unit-tests/var-op-expand.mk  Sat Nov 13 18:37:42 2021 +0000
+++ b/usr.bin/make/unit-tests/var-op-expand.mk  Sat Nov 13 19:02:07 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: var-op-expand.mk,v 1.12 2021/11/13 18:37:42 rillig Exp $
+# $NetBSD: var-op-expand.mk,v 1.13 2021/11/13 19:02:07 rillig Exp $
 #
 # Tests for the := variable assignment operator, which expands its
 # right-hand side.
@@ -223,10 +223,10 @@
 # As of 2021-11-13, the actual behavior is unexpected though since
 .undef LATER
 .undef later
-INDIRECT:=     ${LATER:S,value,replaced,}
+INDIRECT:=     ${LATER:S,value,replaced,} OK ${LATER:value=sysv}
 indirect:=     ${INDIRECT:tl}
 # expect+1: Unknown modifier "s,value,replaced,"
-.if ${indirect} != ""
+.if ${indirect} != " ok "
 .  error
 .else
 .  warning     XXX Neither branch should be taken.
@@ -234,7 +234,7 @@
 LATER= uppercase-value
 later= lowercase-value
 # expect+1: Unknown modifier "s,value,replaced,"
-.if ${indirect} != "uppercase-replaced"
+.if ${indirect} != "uppercase-replaced ok uppercase-sysv"
 .  warning     XXX Neither branch should be taken.
 .else
 .  error



Home | Main Index | Thread Index | Old Index