Module Name: src
Committed By: rillig
Date: Fri Oct 30 14:46:01 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: cond-cmp-string.exp cond-cmp-string.mk
Log Message:
make(1): add more test cases that fail in condition string literals
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/cond-cmp-string.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/cond-cmp-string.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/cond-cmp-string.exp
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.5 src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.6
--- src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.5 Fri Oct 30 08:13:17 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.exp Fri Oct 30 14:46:01 2020
@@ -4,6 +4,8 @@ make: "cond-cmp-string.mk" line 42: warn
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
Index: src/usr.bin/make/unit-tests/cond-cmp-string.mk
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.8 src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.9
--- src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.8 Fri Oct 30 13:41:14 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.mk Fri Oct 30 14:46:01 2020
@@ -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