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: add test for confusing double ...



details:   https://anonhg.NetBSD.org/src/rev/b7ceb89f86af
branches:  trunk
changeset: 959723:b7ceb89f86af
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 22 23:59:43 2021 +0000

description:
make: add test for confusing double space in error message

diffstat:

 usr.bin/make/unit-tests/varmod-edge.exp |   4 ++++
 usr.bin/make/unit-tests/varmod-edge.mk  |  20 +++++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletions(-)

diffs (47 lines):

diff -r ada352dacf10 -r b7ceb89f86af usr.bin/make/unit-tests/varmod-edge.exp
--- a/usr.bin/make/unit-tests/varmod-edge.exp   Mon Feb 22 23:46:03 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.exp   Mon Feb 22 23:59:43 2021 +0000
@@ -18,6 +18,10 @@
 make: "varmod-edge.mk" line 165: Unknown modifier ':'
 make: "varmod-edge.mk" line 165: Unknown modifier ':'
 make: "varmod-edge.mk" line 166: ok colons
+make: "varmod-edge.mk" line 175: Unknown modifier 'Z'
+make: "varmod-edge.mk" line 175: Malformed conditional (${:Z})
+make: Unfinished modifier for  (',' missing)
+make: "varmod-edge.mk" line 184: Malformed conditional (${:S,})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r ada352dacf10 -r b7ceb89f86af usr.bin/make/unit-tests/varmod-edge.mk
--- a/usr.bin/make/unit-tests/varmod-edge.mk    Mon Feb 22 23:46:03 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.mk    Mon Feb 22 23:59:43 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-edge.mk,v 1.13 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: varmod-edge.mk,v 1.14 2021/02/22 23:59:43 rillig Exp $
 #
 # Tests for edge cases in variable modifiers.
 #
@@ -169,5 +169,23 @@
 .  endif
 .endfor
 
+# Even in expressions based on an unnamed variable, there may be errors.
+# XXX: The error message should mention the variable name of the expression,
+# even though that name is empty in this case.
+.if ${:Z}
+.  error
+.else
+.  error
+.endif
+
+# Even in expressions based on an unnamed variable, there may be errors.
+# XXX: The error message should not contain two spaces in a row.
+# XXX: The error message should report the filename:lineno.
+.if ${:S,}
+.  error
+.else
+.  error
+.endif
+
 all:
        @echo ok



Home | Main Index | Thread Index | Old Index