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: describe the absent fall...



details:   https://anonhg.NetBSD.org/src/rev/8908c03366a0
branches:  trunk
changeset: 373765:8908c03366a0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 27 08:29:36 2023 +0000

description:
tests/make: describe the absent fallback for ':O' modifiers more clearly

diffstat:

 usr.bin/make/unit-tests/varmod-order.exp |   2 +-
 usr.bin/make/unit-tests/varmod-order.mk  |  14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 332db1d9e620 -r 8908c03366a0 usr.bin/make/unit-tests/varmod-order.exp
--- a/usr.bin/make/unit-tests/varmod-order.exp  Mon Feb 27 00:34:11 2023 +0000
+++ b/usr.bin/make/unit-tests/varmod-order.exp  Mon Feb 27 08:29:36 2023 +0000
@@ -20,7 +20,7 @@
 make: Bad modifier ":Orrn" for variable "NUMBERS"
 make: "varmod-order.mk" line 86: Malformed conditional (${NUMBERS:Orrn})
 make: Bad modifier ":On=Off" for variable "SWITCH"
-make: "varmod-order.mk" line 96: Malformed conditional (${SWITCH:UOn:On=Off} != "Off")
+make: "varmod-order.mk" line 100: Malformed conditional (${SWITCH:On=Off} != "Off")
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r 332db1d9e620 -r 8908c03366a0 usr.bin/make/unit-tests/varmod-order.mk
--- a/usr.bin/make/unit-tests/varmod-order.mk   Mon Feb 27 00:34:11 2023 +0000
+++ b/usr.bin/make/unit-tests/varmod-order.mk   Mon Feb 27 08:29:36 2023 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-order.mk,v 1.9 2023/02/26 06:08:06 rillig Exp $
+# $NetBSD: varmod-order.mk,v 1.10 2023/02/27 08:29:36 rillig Exp $
 #
 # Tests for the :O variable modifier and its variants, which either sort the
 # words of the value or shuffle them.
@@ -90,10 +90,14 @@
 .endif
 
 
-# Any modifier that starts with 'O' either sorts or shuffles the words.  Other
-# than for many other modifiers, there is no fallback to the SysV modifier
-# ':from=to'.
-.if ${SWITCH:UOn:On=Off} != "Off"
+# If a modifier that starts with ':O' is not one of the known sort or shuffle
+# forms, it is a parse error.  Several other modifiers such as ':H' or ':u'
+# fall back to the SysV modifier, for example, ':H=new' is not the standard
+# ':H' modifier but instead replaces a trailing 'H' with 'new' in each word.
+# There is no such fallback for the ':O' modifiers.
+SWITCH=        On
+# expect: make: Bad modifier ":On=Off" for variable "SWITCH"
+.if ${SWITCH:On=Off} != "Off"
 .  error
 .else
 .  error



Home | Main Index | Thread Index | Old Index