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: document today's bug fix...



details:   https://anonhg.NetBSD.org/src/rev/fd7c7a6ad11e
branches:  trunk
changeset: 981560:fd7c7a6ad11e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Mar 14 20:41:39 2021 +0000

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

diffstat:

 usr.bin/make/unit-tests/var-eval-short.exp |  10 +++++-----
 usr.bin/make/unit-tests/var-eval-short.mk  |  16 +++++++++++++++-
 2 files changed, 20 insertions(+), 6 deletions(-)

diffs (75 lines):

diff -r 3d91ac06b20e -r fd7c7a6ad11e usr.bin/make/unit-tests/var-eval-short.exp
--- a/usr.bin/make/unit-tests/var-eval-short.exp        Sun Mar 14 20:23:29 2021 +0000
+++ b/usr.bin/make/unit-tests/var-eval-short.exp        Sun Mar 14 20:41:39 2021 +0000
@@ -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 @@
 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
diff -r 3d91ac06b20e -r fd7c7a6ad11e usr.bin/make/unit-tests/var-eval-short.mk
--- a/usr.bin/make/unit-tests/var-eval-short.mk Sun Mar 14 20:23:29 2021 +0000
+++ b/usr.bin/make/unit-tests/var-eval-short.mk Sun Mar 14 20:41:39 2021 +0000
@@ -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 @@
 .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
 



Home | Main Index | Thread Index | Old Index