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: add more tests for unusu...
details: https://anonhg.NetBSD.org/src/rev/38b2a09b8ec7
branches: trunk
changeset: 374620:38b2a09b8ec7
user: rillig <rillig%NetBSD.org@localhost>
date: Mon May 08 09:24:42 2023 +0000
description:
tests/make: add more tests for unusual variable names in .for loops
diffstat:
usr.bin/make/unit-tests/directive-for.exp | 23 +++++++++++++----------
usr.bin/make/unit-tests/directive-for.mk | 14 +++++++++++++-
2 files changed, 26 insertions(+), 11 deletions(-)
diffs (61 lines):
diff -r 8bb91cffe723 -r 38b2a09b8ec7 usr.bin/make/unit-tests/directive-for.exp
--- a/usr.bin/make/unit-tests/directive-for.exp Mon May 08 09:01:20 2023 +0000
+++ b/usr.bin/make/unit-tests/directive-for.exp Mon May 08 09:24:42 2023 +0000
@@ -16,16 +16,19 @@ make: "directive-for.mk" line 140: ][ ][
make: "directive-for.mk" line 140: }{ }{ }{
make: "directive-for.mk" line 148: outer value value
make: "directive-for.mk" line 148: outer "quoted" \"quoted\"
-make: "directive-for.mk" line 154: Unknown modifier "Z"
-make: "directive-for.mk" line 155: XXX: Not reached word1
-make: "directive-for.mk" line 155: XXX: Not reached word3
-make: "directive-for.mk" line 160: no iteration variables in for
-make: "directive-for.mk" line 162: Missing argument for ".error"
-make: "directive-for.mk" line 163: for-less endfor
-make: "directive-for.mk" line 187: 1 open conditional
-make: "directive-for.mk" line 203: for-less endfor
-make: "directive-for.mk" line 204: if-less endif
-make: "directive-for.mk" line 212: if-less endif
+make: "directive-for.mk" line 154: $ value value
+make: "directive-for.mk" line 160: <> <> <a>
+make: "directive-for.mk" line 160: <> <> <b>
+make: "directive-for.mk" line 166: Unknown modifier "Z"
+make: "directive-for.mk" line 167: XXX: Not reached word1
+make: "directive-for.mk" line 167: XXX: Not reached word3
+make: "directive-for.mk" line 172: no iteration variables in for
+make: "directive-for.mk" line 174: Missing argument for ".error"
+make: "directive-for.mk" line 175: for-less endfor
+make: "directive-for.mk" line 199: 1 open conditional
+make: "directive-for.mk" line 215: for-less endfor
+make: "directive-for.mk" line 216: if-less endif
+make: "directive-for.mk" line 224: if-less endif
For: new loop 2
For: end for 2
For: end for 1
diff -r 8bb91cffe723 -r 38b2a09b8ec7 usr.bin/make/unit-tests/directive-for.mk
--- a/usr.bin/make/unit-tests/directive-for.mk Mon May 08 09:01:20 2023 +0000
+++ b/usr.bin/make/unit-tests/directive-for.mk Mon May 08 09:24:42 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.16 2023/05/08 09:01:20 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.17 2023/05/08 09:24:42 rillig Exp $
#
# Tests for the .for directive.
#
@@ -147,6 +147,18 @@ var= outer
.for var:Q in value "quoted"
. info ${var} ${var:Q} ${var:Q:Q}
.endfor
+# The short expression '$$' is preserved, the long expressions are
+# substituted.
+# expect+2: $ value value
+.for $ in value
+. info $$ ${$} $($)
+.endfor
+# From https://gnats.netbsd.org/53146.
+# expect+3: <> <> <a>
+# expect+2: <> <> <b>
+.for $(FOO) in a b
+. info <$(FOO)> <$(foo)> <$($(FOO))>
+.endfor
# XXX: A parse error or evaluation error in the items of the .for loop
Home |
Main Index |
Thread Index |
Old Index