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 tests for :!...! parse ...



details:   https://anonhg.NetBSD.org/src/rev/0d05743b4ca3
branches:  trunk
changeset: 936395:0d05743b4ca3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 26 14:39:46 2020 +0000

description:
make(1): add tests for :!...! parse errors

diffstat:

 usr.bin/make/unit-tests/moderrs.exp |   5 +++++
 usr.bin/make/unit-tests/moderrs.mk  |  12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 29f6c66b1f9d -r 0d05743b4ca3 usr.bin/make/unit-tests/moderrs.exp
--- a/usr.bin/make/unit-tests/moderrs.exp       Sun Jul 26 14:22:22 2020 +0000
+++ b/usr.bin/make/unit-tests/moderrs.exp       Sun Jul 26 14:39:46 2020 +0000
@@ -26,4 +26,9 @@
 
 13=
 12345=ok
+Expect: 2 errors about missing ! delimiter
+make: Unclosed substitution for VARNAME (! missing)
+
+make: Unclosed substitution for ! (! missing)
+
 exit status 0
diff -r 29f6c66b1f9d -r 0d05743b4ca3 usr.bin/make/unit-tests/moderrs.mk
--- a/usr.bin/make/unit-tests/moderrs.mk        Sun Jul 26 14:22:22 2020 +0000
+++ b/usr.bin/make/unit-tests/moderrs.mk        Sun Jul 26 14:39:46 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: moderrs.mk,v 1.3 2020/07/26 14:16:45 rillig Exp $
+# $Id: moderrs.mk,v 1.4 2020/07/26 14:39:46 rillig Exp $
 #
 # various modifier error tests
 
@@ -10,6 +10,7 @@
 
 all:   modunkn modunknV varterm vartermV modtermV modloop
 all:   modwords
+all:   modexclam
 
 modunkn:
        @echo "Expect: Unknown modifier 'Z'"
@@ -57,3 +58,12 @@
        # This results in a range from LONG_MAX - 1 to 3,
        # which is empty.
        @echo 12345=${UNDEF:U1 2 3:[123451234512345123451234512345]:S,^$,ok,:S,^3$,ok,}
+
+modexclam:
+       @echo "Expect: 2 errors about missing ! delimiter"
+       @echo ${VARNAME:!echo}
+       # When the final exclamation mark is missing, there is no
+       # fallback to the SysV substitution modifier.
+       # If there were a fallback, the output would be "exclam",
+       # and the above would have produced an "Unknown modifier '!'".
+       @echo ${!:L:!=exclam}



Home | Main Index | Thread Index | Old Index