From 7a930d5d3281f62e9433e11f373f7ac5ae55b879 Mon Sep 17 00:00:00 2001 From: rillig Date: Fri, 30 Oct 2020 13:41:14 +0000 Subject: [PATCH] make(1): add test for two variable expressions in a string literal --- usr.bin/make/unit-tests/cond-cmp-string.mk | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/usr.bin/make/unit-tests/cond-cmp-string.mk b/usr.bin/make/unit-tests/cond-cmp-string.mk index 01a3b11613f9..f4f35e1a31fe 100644 --- a/usr.bin/make/unit-tests/cond-cmp-string.mk +++ b/usr.bin/make/unit-tests/cond-cmp-string.mk @@ -1,4 +1,4 @@ -# $NetBSD: cond-cmp-string.mk,v 1.7 2020/10/30 08:13:17 rillig Exp $ +# $NetBSD: cond-cmp-string.mk,v 1.8 2020/10/30 13:41:14 rillig Exp $ # # Tests for string comparisons in .if conditions. @@ -57,8 +57,8 @@ . error .endif -# XXX: As of 2020-10-30, adding a space to the string results in a parse -# error. This is a bug and should have been caught much earlier. +# XXX: As of 2020-10-30, adding literal characters to the string results +# in a parse error. This is a bug and should have been caught much earlier. # I wonder since when it exists. .if ${:Uword} != "${:Uword} " . error @@ -66,6 +66,11 @@ . error .endif +# Adding another variable expression to the string literal works though. +.if ${:Uword} != "${:Uwo}${:Urd}" +. error +.endif + # Adding a space at the beginning of the quoted variable expression works # though. .if ${:U word } != " ${:Uword} "