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 another example for ...
details: https://anonhg.NetBSD.org/src/rev/58ce084c11ab
branches: trunk
changeset: 982640:58ce084c11ab
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Apr 19 23:43:14 2021 +0000
description:
tests/make: add another example for parsing of the modifier ':?'
diffstat:
usr.bin/make/unit-tests/varmod-ifelse.exp | 4 ++++
usr.bin/make/unit-tests/varmod-ifelse.mk | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diffs (33 lines):
diff -r d57f8b0ee683 -r 58ce084c11ab usr.bin/make/unit-tests/varmod-ifelse.exp
--- a/usr.bin/make/unit-tests/varmod-ifelse.exp Mon Apr 19 23:27:17 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-ifelse.exp Mon Apr 19 23:43:14 2021 +0000
@@ -19,6 +19,10 @@
make: "varmod-ifelse.mk" line 153: .
make: Bad conditional expression 'string == "literal" || no >= 10' in 'string == "literal" || no >= 10?yes:no'
make: "varmod-ifelse.mk" line 154: .
+make: Bad conditional expression 'string == "literal" && >= 10' in 'string == "literal" && >= 10?yes:no'
+make: "varmod-ifelse.mk" line 159: .
+make: Bad conditional expression 'string == "literal" || >= 10' in 'string == "literal" || >= 10?yes:no'
+make: "varmod-ifelse.mk" line 160: .
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
diff -r d57f8b0ee683 -r 58ce084c11ab usr.bin/make/unit-tests/varmod-ifelse.mk
--- a/usr.bin/make/unit-tests/varmod-ifelse.mk Mon Apr 19 23:27:17 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-ifelse.mk Mon Apr 19 23:43:14 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-ifelse.mk,v 1.14 2021/04/19 23:27:17 rillig Exp $
+# $NetBSD: varmod-ifelse.mk,v 1.15 2021/04/19 23:43:14 rillig Exp $
#
# Tests for the ${cond:?then:else} variable modifier, which evaluates either
# the then-expression or the else-expression, depending on the condition.
@@ -152,3 +152,9 @@
NUMBER= no # not really a number
.info ${${STRING} == "literal" && ${NUMBER} >= 10:?yes:no}.
.info ${${STRING} == "literal" || ${NUMBER} >= 10:?yes:no}.
+
+# The following situation occasionally occurs with MKINET6 or similar
+# variables.
+NUMBER= # empty, not really a number either
+.info ${${STRING} == "literal" && ${NUMBER} >= 10:?yes:no}.
+.info ${${STRING} == "literal" || ${NUMBER} >= 10:?yes:no}.
Home |
Main Index |
Thread Index |
Old Index