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 make(1): add test for two variable e...



details:   https://anonhg.NetBSD.org/src/rev/2ce2fea96511
branches:  trunk
changeset: 945429:2ce2fea96511
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 30 13:41:14 2020 +0000

description:
make(1): add test for two variable expressions in a string literal

diffstat:

 usr.bin/make/unit-tests/cond-cmp-string.mk |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 17bf73c89882 -r 2ce2fea96511 usr.bin/make/unit-tests/cond-cmp-string.mk
--- a/usr.bin/make/unit-tests/cond-cmp-string.mk        Fri Oct 30 12:32:04 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-cmp-string.mk        Fri Oct 30 13:41:14 2020 +0000
@@ -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} "



Home | Main Index | Thread Index | Old Index