Module Name: src
Committed By: rillig
Date: Fri Sep 11 15:33:28 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: cond-cmp-numeric-eq.exp
cond-cmp-numeric-eq.mk cond-cmp-string.exp cond-cmp-string.mk
Log Message:
make(1): fix tests about nonexistent = and === operators
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk \
src/usr.bin/make/unit-tests/cond-cmp-string.exp
cvs rdiff -u -r1.4 -r1.5 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-numeric-eq.exp
diff -u src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp:1.1 src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp:1.2
--- src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp:1.1 Sun Aug 23 13:50:17 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp Fri Sep 11 15:33:28 2020
@@ -1 +1,6 @@
-exit status 0
+make: "cond-cmp-numeric-eq.mk" line 54: warning: Unknown operator
+make: "cond-cmp-numeric-eq.mk" line 54: Malformed conditional (!(12345 = 12345))
+make: "cond-cmp-numeric-eq.mk" line 61: Malformed conditional (!(12345 === 12345))
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1
Index: src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk
diff -u src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk:1.2 src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk:1.3
--- src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk:1.2 Fri Sep 11 15:19:04 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk Fri Sep 11 15:33:28 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-numeric-eq.mk,v 1.2 2020/09/11 15:19:04 rillig Exp $
+# $NetBSD: cond-cmp-numeric-eq.mk,v 1.3 2020/09/11 15:33:28 rillig Exp $
#
# Tests for numeric comparisons with the == operator in .if conditions.
@@ -50,8 +50,7 @@
.endif
-# There is no = operator for numbers. Well, not quite, there is one, but
-# it generates a warning. Therefore it is not used in practice.
+# There is no = operator for numbers.
.if !(12345 = 12345)
. error
.else
Index: src/usr.bin/make/unit-tests/cond-cmp-string.exp
diff -u src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.2 src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.3
--- src/usr.bin/make/unit-tests/cond-cmp-string.exp:1.2 Thu Aug 20 18:43:19 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.exp Fri Sep 11 15:33:28 2020
@@ -1,5 +1,8 @@
make: "cond-cmp-string.mk" line 18: Malformed conditional (str != str)
make: "cond-cmp-string.mk" line 37: Malformed conditional ("string" != "str""ing")
+make: "cond-cmp-string.mk" line 42: warning: String comparison operator should be either == or !=
+make: "cond-cmp-string.mk" line 42: Malformed conditional (!("value" = "value"))
+make: "cond-cmp-string.mk" line 49: Malformed conditional (!("value" === "value"))
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.4 src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.5
--- src/usr.bin/make/unit-tests/cond-cmp-string.mk:1.4 Fri Sep 11 15:19:04 2020
+++ src/usr.bin/make/unit-tests/cond-cmp-string.mk Fri Sep 11 15:33:28 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.4 2020/09/11 15:19:04 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.5 2020/09/11 15:33:28 rillig Exp $
#
# Tests for string comparisons in .if conditions.
@@ -38,8 +38,7 @@
.error
.endif
-# There is no = operator for strings. Well, not quite, there is one, but
-# it generates a warning. Therefore it is not used in practice.
+# There is no = operator for strings.
.if !("value" = "value")
. error
.else