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: make test for '::=' easi...



details:   https://anonhg.NetBSD.org/src/rev/d2045a50f5c7
branches:  trunk
changeset: 1026741:d2045a50f5c7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 05 10:13:44 2021 +0000

description:
tests/make: make test for '::=' easier to read, fix comments

diffstat:

 usr.bin/make/unit-tests/varmod-assign.mk |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (43 lines):

diff -r b4d84d7ff935 -r d2045a50f5c7 usr.bin/make/unit-tests/varmod-assign.mk
--- a/usr.bin/make/unit-tests/varmod-assign.mk  Sun Dec 05 10:11:31 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-assign.mk  Sun Dec 05 10:13:44 2021 +0000
@@ -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 @@
 # 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
 



Home | Main Index | Thread Index | Old Index