Sun Mar 14 17:07:11 2021 UTC ()
tests/make: convert test for ':_' modifier to parse time


(rillig)
diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-remember.exp
diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-remember.mk

cvs diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-remember.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-remember.exp 2020/08/23 15:18:43 1.2
+++ src/usr.bin/make/unit-tests/varmod-remember.exp 2021/03/14 17:07:11 1.3

cvs diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-remember.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-remember.mk 2020/08/23 15:18:43 1.3
+++ src/usr.bin/make/unit-tests/varmod-remember.mk 2021/03/14 17:07:11 1.4
@@ -1,12 +1,20 @@ @@ -1,12 +1,20 @@
1# $NetBSD: varmod-remember.mk,v 1.3 2020/08/23 15:18:43 rillig Exp $ 1# $NetBSD: varmod-remember.mk,v 1.4 2021/03/14 17:07:11 rillig Exp $
2# 2#
3# Tests for the :_ modifier, which saves the current variable value 3# Tests for the :_ modifier, which saves the current variable value
4# in the _ variable or another, to be used later again. 4# in the _ variable or another, to be used later again.
5 5
 6.if ${1 2 3:L:_:@var@${_}@} != "1 2 3 1 2 3 1 2 3"
 7. error
 8.endif
 9
6# In the parameterized form, having the variable name on the right side of 10# In the parameterized form, having the variable name on the right side of
7# the = assignment operator is confusing. In almost all other situations 11# the = assignment operator is confusing. In almost all other situations
8# the variable name is on the left-hand side of the = operator. Luckily 12# the variable name is on the left-hand side of the = operator. Luckily
9# this modifier is only rarely needed. 13# this modifier is only rarely needed.
 14.if ${1 2 3:L:@var@${var:_=SAVED:}@} != "1 2 3"
 15. error
 16.elif ${SAVED} != "3"
 17. error
 18.endif
 19
10all: 20all:
11 @echo ${1 2 3:L:_:@var@${_}@} 
12 @echo ${1 2 3:L:@var@${var:_=SAVED:}@}, SAVED=${SAVED}