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 unclosed varia...



details:   https://anonhg.NetBSD.org/src/rev/4bd2df8d76a9
branches:  trunk
changeset: 974259:4bd2df8d76a9
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 26 21:09:49 2020 +0000

description:
make(1): add test for unclosed variables

diffstat:

 usr.bin/make/unit-tests/varmisc.exp |   6 ++++++
 usr.bin/make/unit-tests/varmisc.mk  |  12 +++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r b7ca2200898c -r 4bd2df8d76a9 usr.bin/make/unit-tests/varmisc.exp
--- a/usr.bin/make/unit-tests/varmisc.exp       Sun Jul 26 20:30:42 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.exp       Sun Jul 26 21:09:49 2020 +0000
@@ -44,4 +44,10 @@
 export-appended: env
 export-appended: env mk
 parse-dynamic: parse-dynamic parse-dynamic before
+varerror-unclosed:begin
+
+make: Unclosed variable specification (expecting '}') for "UNCLOSED" (value "") modifier M
+
+
+varerror-unclosed:end
 exit status 0
diff -r b7ca2200898c -r 4bd2df8d76a9 usr.bin/make/unit-tests/varmisc.mk
--- a/usr.bin/make/unit-tests/varmisc.mk        Sun Jul 26 20:30:42 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.mk        Sun Jul 26 21:09:49 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: varmisc.mk,v 1.15 2020/07/26 20:30:42 rillig Exp $
+# $Id: varmisc.mk,v 1.16 2020/07/26 21:09:49 rillig Exp $
 #
 # Miscellaneous variable tests.
 
@@ -7,6 +7,7 @@
 all: save-dollars
 all: export-appended
 all: parse-dynamic
+all: varerror-unclosed
 
 unmatched_var_paren:
        @echo ${foo::=foo-text}
@@ -174,3 +175,12 @@
 
 parse-dynamic:
        @echo $@: ${G_TARGET} ${G_MEMBER} ${G_PREFIX} ${G_ARCHIVE} ${G_ALLSRC}
+
+# As of 2020-07-26, make does not complain about unclosed variables.
+# It does complain about unclosed variables when parsing modifiers though.
+varerror-unclosed:
+       @echo $@:begin
+       @echo ${UNCLOSED
+       @echo ${UNCLOSED:M${PATTERN
+       @echo ${UNCLOSED.${param
+       @echo $@:end



Home | Main Index | Thread Index | Old Index