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 tests/make: add expectations for str...
details: https://anonhg.NetBSD.org/src/rev/b4929896a36f
branches: trunk
changeset: 374043:b4929896a36f
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Mar 28 14:38:29 2023 +0000
description:
tests/make: add expectations for string comparison errors
diffstat:
usr.bin/make/unit-tests/cond-cmp-string.exp | 16 ++++++++--------
usr.bin/make/unit-tests/cond-cmp-string.mk | 10 +++++++++-
2 files changed, 17 insertions(+), 9 deletions(-)
diffs (96 lines):
diff -r 8c5fd8ddd059 -r b4929896a36f usr.bin/make/unit-tests/cond-cmp-string.exp
--- a/usr.bin/make/unit-tests/cond-cmp-string.exp Tue Mar 28 10:54:13 2023 +0000
+++ b/usr.bin/make/unit-tests/cond-cmp-string.exp Tue Mar 28 14:38:29 2023 +0000
@@ -1,11 +1,11 @@
-make: "cond-cmp-string.mk" line 18: Malformed conditional (str != str)
-make: "cond-cmp-string.mk" line 42: Malformed conditional ("string" != "str""ing")
-make: "cond-cmp-string.mk" line 49: Malformed conditional (!("value" = "value"))
-make: "cond-cmp-string.mk" line 56: Malformed conditional (!("value" === "value"))
-make: "cond-cmp-string.mk" line 113: Comparison with '<' requires both operands 'string' and 'string' to be numeric
-make: "cond-cmp-string.mk" line 120: Comparison with '<=' requires both operands 'string' and 'string' to be numeric
-make: "cond-cmp-string.mk" line 127: Comparison with '>' requires both operands 'string' and 'string' to be numeric
-make: "cond-cmp-string.mk" line 134: Comparison with '>=' requires both operands 'string' and 'string' to be numeric
+make: "cond-cmp-string.mk" line 19: Malformed conditional (str != str)
+make: "cond-cmp-string.mk" line 44: Malformed conditional ("string" != "str""ing")
+make: "cond-cmp-string.mk" line 52: Malformed conditional (!("value" = "value"))
+make: "cond-cmp-string.mk" line 60: Malformed conditional (!("value" === "value"))
+make: "cond-cmp-string.mk" line 118: Comparison with '<' requires both operands 'string' and 'string' to be numeric
+make: "cond-cmp-string.mk" line 126: Comparison with '<=' requires both operands 'string' and 'string' to be numeric
+make: "cond-cmp-string.mk" line 134: Comparison with '>' requires both operands 'string' and 'string' to be numeric
+make: "cond-cmp-string.mk" line 142: Comparison with '>=' requires both operands 'string' and 'string' to be numeric
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
diff -r 8c5fd8ddd059 -r b4929896a36f usr.bin/make/unit-tests/cond-cmp-string.mk
--- a/usr.bin/make/unit-tests/cond-cmp-string.mk Tue Mar 28 10:54:13 2023 +0000
+++ b/usr.bin/make/unit-tests/cond-cmp-string.mk Tue Mar 28 14:38:29 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cond-cmp-string.mk,v 1.16 2022/05/08 06:51:27 rillig Exp $
+# $NetBSD: cond-cmp-string.mk,v 1.17 2023/03/28 14:38:29 rillig Exp $
#
# Tests for string comparisons in .if conditions.
@@ -15,6 +15,7 @@
# The left-hand side of the comparison must be enclosed in quotes.
# This one is not enclosed in quotes and thus generates an error message.
+# expect+1: Malformed conditional (str != str)
.if str != str
. error
.endif
@@ -39,6 +40,7 @@
# It is not possible to concatenate two string literals to form a single
# string. In C, Python and the shell this is possible, but not in make.
+# expect+1: Malformed conditional ("string" != "str""ing")
.if "string" != "str""ing"
. error
.else
@@ -46,6 +48,7 @@
.endif
# There is no = operator for strings.
+# expect+1: Malformed conditional (!("value" = "value"))
.if !("value" = "value")
. error
.else
@@ -53,6 +56,7 @@
.endif
# There is no === operator for strings either.
+# expect+1: Malformed conditional (!("value" === "value"))
.if !("value" === "value")
. error
.else
@@ -110,6 +114,7 @@
.endif
# Strings cannot be compared relationally, only for equality.
+# expect+1: Comparison with '<' requires both operands 'string' and 'string' to be numeric
.if "string" < "string"
. error
.else
@@ -117,6 +122,7 @@
.endif
# Strings cannot be compared relationally, only for equality.
+# expect+1: Comparison with '<=' requires both operands 'string' and 'string' to be numeric
.if "string" <= "string"
. error
.else
@@ -124,6 +130,7 @@
.endif
# Strings cannot be compared relationally, only for equality.
+# expect+1: Comparison with '>' requires both operands 'string' and 'string' to be numeric
.if "string" > "string"
. error
.else
@@ -131,6 +138,7 @@
.endif
# Strings cannot be compared relationally, only for equality.
+# expect+1: Comparison with '>=' requires both operands 'string' and 'string' to be numeric
.if "string" >= "string"
. error
.else
Home |
Main Index |
Thread Index |
Old Index