Module Name:    src
Committed By:   rillig
Date:           Sat Nov 13 19:02:08 UTC 2021

Modified Files:
        src/usr.bin/make/unit-tests: var-op-expand.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/var-op-expand.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/var-op-expand.mk
diff -u src/usr.bin/make/unit-tests/var-op-expand.mk:1.12 src/usr.bin/make/unit-tests/var-op-expand.mk:1.13
--- src/usr.bin/make/unit-tests/var-op-expand.mk:1.12	Sat Nov 13 18:37:42 2021
+++ src/usr.bin/make/unit-tests/var-op-expand.mk	Sat Nov 13 19:02:07 2021
@@ -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 @@ later=	lowercase-value
 # 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 @@ indirect:=	${INDIRECT:tl}
 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

Reply via email to