Module Name: src Committed By: rillig Date: Sun Dec 5 10:13:44 UTC 2021
Modified Files: src/usr.bin/make/unit-tests: varmod-assign.mk Log Message: tests/make: make test for '::=' easier to read, fix comments To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varmod-assign.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/varmod-assign.mk diff -u src/usr.bin/make/unit-tests/varmod-assign.mk:1.13 src/usr.bin/make/unit-tests/varmod-assign.mk:1.14 --- src/usr.bin/make/unit-tests/varmod-assign.mk:1.13 Tue Nov 30 20:48:01 2021 +++ src/usr.bin/make/unit-tests/varmod-assign.mk Sun Dec 5 10:13:44 2021 @@ -1,4 +1,4 @@ -# $NetBSD: varmod-assign.mk,v 1.13 2021/11/30 20:48:01 rillig Exp $ +# $NetBSD: varmod-assign.mk,v 1.14 2021/12/05 10:13:44 rillig Exp $ # # Tests for the obscure ::= variable modifiers, which perform variable # assignments during evaluation, just like the = operator in C. @@ -44,24 +44,24 @@ all: mod-assign-shell-error # used in practice. # The condition "1" is true, therefore THEN1 gets assigned a value, -# and IT1 as well. Nothing surprising here. -.if "${1:?${THEN1::=then1${IT1::=t1}}:${ELSE1::=else1${IE1::=e1}}}${THEN1}${ELSE1}${IT1}${IE1}" != "then1t1" +# and the inner IT1 as well. Nothing surprising here. +.if "${1:?${THEN1::=then1${IT1::=t1}}:${ELSE1::=else1${IE1::=e1}}} ${THEN1}${ELSE1}${IT1}${IE1}" != " then1t1" . error .endif -# The condition "0" is false, therefore ELSE1 gets assigned a value, -# and IE1 as well. Nothing surprising here as well. -.if "${0:?${THEN2::=then2${IT2::=t2}}:${ELSE2::=else2${IE2::=e2}}}${THEN2}${ELSE2}${IT2}${IE2}" != "else2e2" +# The condition "0" is false, therefore ELSE2 gets assigned a value, +# and the inner IE2 as well. Nothing surprising here as well. +.if "${0:?${THEN2::=then2${IT2::=t2}}:${ELSE2::=else2${IE2::=e2}}} ${THEN2}${ELSE2}${IT2}${IE2}" != " else2e2" . error .endif # The same effects happen when the variables are defined elsewhere. -SINK3:= ${1:?${THEN3::=then3${IT3::=t3}}:${ELSE3::=else3${IE3::=e3}}}${THEN3}${ELSE3}${IT3}${IE3} -SINK4:= ${0:?${THEN4::=then4${IT4::=t4}}:${ELSE4::=else4${IE4::=e4}}}${THEN4}${ELSE4}${IT4}${IE4} -.if ${SINK3} != "then3t3" +SINK3:= ${1:?${THEN3::=then3${IT3::=t3}}:${ELSE3::=else3${IE3::=e3}}} ${THEN3}${ELSE3}${IT3}${IE3} +SINK4:= ${0:?${THEN4::=then4${IT4::=t4}}:${ELSE4::=else4${IE4::=e4}}} ${THEN4}${ELSE4}${IT4}${IE4} +.if ${SINK3} != " then3t3" . error .endif -.if ${SINK4} != "else4e4" +.if ${SINK4} != " else4e4" . error .endif