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 make(1): add test for empty modifier...
details: https://anonhg.NetBSD.org/src/rev/e5efa6f26ffc
branches: trunk
changeset: 936673:e5efa6f26ffc
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Aug 01 15:13:45 2020 +0000
description:
make(1): add test for empty modifier list after colon
This is a good candidate for becoming an error in strict mode.
Either write ${VAR} or write ${VAR:modifiers}, but not half-baked.
diffstat:
usr.bin/make/unit-tests/varmod-edge.exp | 1 +
usr.bin/make/unit-tests/varmod-edge.mk | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diffs (30 lines):
diff -r 004c7883ad3f -r e5efa6f26ffc usr.bin/make/unit-tests/varmod-edge.exp
--- a/usr.bin/make/unit-tests/varmod-edge.exp Sat Aug 01 15:03:43 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.exp Sat Aug 01 15:13:45 2020 +0000
@@ -14,4 +14,5 @@
ok eq-q
ok eq-bs
ok eq-esc
+ok colon
exit status 0
diff -r 004c7883ad3f -r e5efa6f26ffc usr.bin/make/unit-tests/varmod-edge.mk
--- a/usr.bin/make/unit-tests/varmod-edge.mk Sat Aug 01 15:03:43 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.mk Sat Aug 01 15:13:45 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-edge.mk,v 1.8 2020/07/19 16:08:24 rillig Exp $
+# $NetBSD: varmod-edge.mk,v 1.9 2020/08/01 15:13:45 rillig Exp $
#
# Tests for edge cases in variable modifiers.
#
@@ -151,6 +151,11 @@
EXP.eq-esc= # empty
# make: Unclosed substitution for INP.eq-esc (= missing)
+TESTS+= colon
+INP.colon= value
+MOD.colon= ${INP.colon:}
+EXP.colon= value
+
all:
.for test in ${TESTS}
. if ${MOD.${test}} == ${EXP.${test}}
Home |
Main Index |
Thread Index |
Old Index