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 more test cases that fa...



details:   https://anonhg.NetBSD.org/src/rev/db30814d1dd8
branches:  trunk
changeset: 945430:db30814d1dd8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 30 14:46:01 2020 +0000

description:
make(1): add more test cases that fail in condition string literals

diffstat:

 usr.bin/make/unit-tests/cond-cmp-string.exp |   2 ++
 usr.bin/make/unit-tests/cond-cmp-string.mk  |  17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 2ce2fea96511 -r db30814d1dd8 usr.bin/make/unit-tests/cond-cmp-string.exp
--- a/usr.bin/make/unit-tests/cond-cmp-string.exp       Fri Oct 30 13:41:14 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-cmp-string.exp       Fri Oct 30 14:46:01 2020 +0000
@@ -4,6 +4,8 @@
 make: "cond-cmp-string.mk" line 42: Malformed conditional (!("value" = "value"))
 make: "cond-cmp-string.mk" line 49: Malformed conditional (!("value" === "value"))
 make: "cond-cmp-string.mk" line 63: Malformed conditional (${:Uword} != "${:Uword} ")
+make: "cond-cmp-string.mk" line 77: Malformed conditional (${:Uword!} != "${:Uword}!")
+make: "cond-cmp-string.mk" line 80: Malformed conditional (${:Uword<} != "${:Uword}<")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r 2ce2fea96511 -r db30814d1dd8 usr.bin/make/unit-tests/cond-cmp-string.mk
--- a/usr.bin/make/unit-tests/cond-cmp-string.mk        Fri Oct 30 13:41:14 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-cmp-string.mk        Fri Oct 30 14:46:01 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.8 2020/10/30 13:41:14 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.9 2020/10/30 14:46:01 rillig Exp $
 #
 # Tests for string comparisons in .if conditions.
 
@@ -66,6 +66,21 @@
 .  error
 .endif
 
+# Some other characters work though, and some don't.
+# Those that are mentioned in is_separator don't work.
+.if ${:Uword0} != "${:Uword}0"
+.  error
+.endif
+.if ${:Uword&} != "${:Uword}&"
+.  error
+.endif
+.if ${:Uword!} != "${:Uword}!"
+.  error
+.endif
+.if ${:Uword<} != "${:Uword}<"
+.  error
+.endif
+
 # Adding another variable expression to the string literal works though.
 .if ${:Uword} != "${:Uwo}${:Urd}"
 .  error



Home | Main Index | Thread Index | Old Index