diff --git a/usr.bin/make/unit-tests/varmod-order.exp b/usr.bin/make/unit-tests/varmod-order.exp index 6013951894b1..e5d03f887fc7 100644 --- a/usr.bin/make/unit-tests/varmod-order.exp +++ b/usr.bin/make/unit-tests/varmod-order.exp @@ -20,7 +20,7 @@ make: "varmod-order.mk" line 77: Malformed conditional (${NUMBERS:Onrr}) 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 --git a/usr.bin/make/unit-tests/varmod-order.mk b/usr.bin/make/unit-tests/varmod-order.mk index 17907e2c0840..b4d5452263c7 100644 --- a/usr.bin/make/unit-tests/varmod-order.mk +++ b/usr.bin/make/unit-tests/varmod-order.mk @@ -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 @@ _:= ${NUMBERS:Onr .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