Module Name:    src
Committed By:   rillig
Date:           Sun Mar 14 20:41:39 UTC 2021

Modified Files:
        src/usr.bin/make/unit-tests: var-eval-short.exp var-eval-short.mk

Log Message:
tests/make: document today's bug fixes in the test


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/var-eval-short.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/var-eval-short.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-eval-short.exp
diff -u src/usr.bin/make/unit-tests/var-eval-short.exp:1.6 src/usr.bin/make/unit-tests/var-eval-short.exp:1.7
--- src/usr.bin/make/unit-tests/var-eval-short.exp:1.6	Sun Mar 14 19:29:37 2021
+++ src/usr.bin/make/unit-tests/var-eval-short.exp	Sun Mar 14 20:41:39 2021
@@ -1,14 +1,14 @@
-make: "var-eval-short.mk" line 63: Invalid time value: ${FAIL}}
-make: "var-eval-short.mk" line 63: Malformed conditional (0 && ${:Uword:gmtime=${FAIL}})
 make: "var-eval-short.mk" line 77: Invalid time value: ${FAIL}}
-make: "var-eval-short.mk" line 77: Malformed conditional (0 && ${:Uword:localtime=${FAIL}})
+make: "var-eval-short.mk" line 77: Malformed conditional (0 && ${:Uword:gmtime=${FAIL}})
+make: "var-eval-short.mk" line 91: Invalid time value: ${FAIL}}
+make: "var-eval-short.mk" line 91: Malformed conditional (0 && ${:Uword:localtime=${FAIL}})
 CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else}
 Var_Parse: ${0:?${FAIL}then:${FAIL}else} with none
 Applying ${0:?...} to "" (none, none, undefined)
 Modifier part: "${FAIL}then"
 Modifier part: "${FAIL}else"
 Result of ${0:?${FAIL}then:${FAIL}else} is "" (none, none, defined)
-ParseReadLine (142): 'DEFINED=	defined'
+ParseReadLine (156): 'DEFINED=	defined'
 Global:DEFINED = defined
 CondParser_Eval: 0 && ${DEFINED:L:?${FAIL}then:${FAIL}else}
 Var_Parse: ${DEFINED:L:?${FAIL}then:${FAIL}else} with none
@@ -18,7 +18,7 @@ Applying ${DEFINED:?...} to "defined" (n
 Modifier part: "${FAIL}then"
 Modifier part: "${FAIL}else"
 Result of ${DEFINED:?${FAIL}then:${FAIL}else} is "defined" (none, none, regular)
-ParseReadLine (145): '.MAKEFLAGS: -d0'
+ParseReadLine (159): '.MAKEFLAGS: -d0'
 ParseDoDependency(.MAKEFLAGS: -d0)
 Global:.MAKEFLAGS =  -r -k -d cpv -d
 Global:.MAKEFLAGS =  -r -k -d cpv -d 0

Index: src/usr.bin/make/unit-tests/var-eval-short.mk
diff -u src/usr.bin/make/unit-tests/var-eval-short.mk:1.3 src/usr.bin/make/unit-tests/var-eval-short.mk:1.4
--- src/usr.bin/make/unit-tests/var-eval-short.mk:1.3	Sun Mar 14 19:21:28 2021
+++ src/usr.bin/make/unit-tests/var-eval-short.mk	Sun Mar 14 20:41:39 2021
@@ -1,4 +1,4 @@
-# $NetBSD: var-eval-short.mk,v 1.3 2021/03/14 19:21:28 rillig Exp $
+# $NetBSD: var-eval-short.mk,v 1.4 2021/03/14 20:41:39 rillig Exp $
 #
 # Tests for each variable modifier to ensure that they only do the minimum
 # necessary computations.  If the result of the expression is not needed, they
@@ -34,20 +34,34 @@ FAIL=	${:!echo unexpected 1>&2!}
 .if 0 && ${0:?${FAIL}:${FAIL}}
 .endif
 
+# Before var.c,v 1.870 from 2021-03-14, the expression ${FAIL} was evaluated
+# after the loop, when undefining the temporary global loop variable.
 .if 0 && ${:Uword:@${FAIL}@expr@}
 .endif
 
 .if 0 && ${:Uword:@var@${FAIL}@}
 .endif
 
+# Before var.c,v 1.877 from 2021-03-14, the modifier ':[...]' did not expand
+# the nested expression ${FAIL} and then tried to parse the unexpanded text,
+# which failed since '$' is not a valid range character.
 .if 0 && ${:Uword:[${FAIL}]}
 .endif
 
+# Before var.c,v 1.867 from 2021-03-14, the modifier ':_' defined the variable
+# even though the whole expression should have only been parsed, not
+# evaluated.
 .if 0 && ${:Uword:_=VAR}
 .elif defined(VAR)
 .  error
 .endif
 
+# Before var.c,v 1.856 from 2021-03-14, the modifier ':C' did not expand the
+# nested expression ${FAIL} and then tried to compile the unexpanded text as a
+# regular expression, which failed both because of the '{FAIL}', which is not
+# a valid repetition, and because of the '****', which are repeated
+# repetitions as well.
+# '${FAIL}'
 .if 0 && ${:Uword:C,${FAIL}****,,}
 .endif
 

Reply via email to