Module Name: src Committed By: rillig Date: Thu Sep 8 20:23:45 UTC 2022
Modified Files: src/usr.bin/make/unit-tests: var-op-expand.exp var-op-expand.mk Log Message: tests/make: extend tests for the ':=' assignment operator To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/var-op-expand.exp cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/var-op-expand.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/var-op-expand.exp diff -u src/usr.bin/make/unit-tests/var-op-expand.exp:1.6 src/usr.bin/make/unit-tests/var-op-expand.exp:1.7 --- src/usr.bin/make/unit-tests/var-op-expand.exp:1.6 Tue Nov 30 23:52:19 2021 +++ src/usr.bin/make/unit-tests/var-op-expand.exp Thu Sep 8 20:23:45 2022 @@ -1,7 +1,7 @@ -make: "var-op-expand.mk" line 265: Unknown modifier "s,value,replaced," -make: "var-op-expand.mk" line 268: warning: XXX Neither branch should be taken. -make: "var-op-expand.mk" line 273: Unknown modifier "s,value,replaced," -make: "var-op-expand.mk" line 274: warning: XXX Neither branch should be taken. +make: "var-op-expand.mk" line 274: Unknown modifier "s,value,replaced," +make: "var-op-expand.mk" line 277: warning: XXX Neither branch should be taken. +make: "var-op-expand.mk" line 282: Unknown modifier "s,value,replaced," +make: "var-op-expand.mk" line 283: warning: XXX Neither branch should be taken. make: Fatal errors encountered -- cannot continue make: stopped in unit-tests exit status 1 Index: src/usr.bin/make/unit-tests/var-op-expand.mk diff -u src/usr.bin/make/unit-tests/var-op-expand.mk:1.16 src/usr.bin/make/unit-tests/var-op-expand.mk:1.17 --- src/usr.bin/make/unit-tests/var-op-expand.mk:1.16 Tue Dec 28 10:47:00 2021 +++ src/usr.bin/make/unit-tests/var-op-expand.mk Thu Sep 8 20:23:45 2022 @@ -1,4 +1,4 @@ -# $NetBSD: var-op-expand.mk,v 1.16 2021/12/28 10:47:00 rillig Exp $ +# $NetBSD: var-op-expand.mk,v 1.17 2022/09/08 20:23:45 rillig Exp $ # # Tests for the := variable assignment operator, which expands its # right-hand side. @@ -37,7 +37,7 @@ VAR:= $$ $$$$ $$$$$$$$ .endif -# reference to a variable containing a literal dollar sign +# reference to a variable containing literal dollar signs REF= $$ $$$$ $$$$$$$$ VAR:= ${REF} REF= too late @@ -49,6 +49,9 @@ REF= too late # reference to an undefined variable .undef UNDEF VAR:= <${UNDEF}> +.if ${VAR} != "<>" +. error +.endif UNDEF= after .if ${VAR} != "<after>" . error @@ -68,6 +71,9 @@ REF= too late # expression with an indirect modifier referring to an undefined variable .undef UNDEF VAR:= ${:${UNDEF}} +.if ${VAR} != "" +. error +.endif UNDEF= Uwas undefined .if ${VAR} != "was undefined" . error @@ -99,6 +105,9 @@ UNDEF= Uwas undefined REF2= <${REF3}> REF= ${REF2} VAR:= ${REF} +.if ${VAR} != "<>" +. error +.endif REF3= too late .if ${VAR} != "<too late>" . error