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 ampersand in S...
details: https://anonhg.NetBSD.org/src/rev/16094db3680e
branches: trunk
changeset: 936115:16094db3680e
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jul 19 14:23:02 2020 +0000
description:
make(1): add test for ampersand in SysV substitution modifier
diffstat:
usr.bin/make/unit-tests/sysv.exp | 2 ++
usr.bin/make/unit-tests/sysv.mk | 14 +++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diffs (42 lines):
diff -r 588363ff1955 -r 16094db3680e usr.bin/make/unit-tests/sysv.exp
--- a/usr.bin/make/unit-tests/sysv.exp Sun Jul 19 14:05:39 2020 +0000
+++ b/usr.bin/make/unit-tests/sysv.exp Sun Jul 19 14:23:02 2020 +0000
@@ -13,4 +13,6 @@
a.c.c
ax:Q b c d eb
+bcd.e
+a.bcd.e
exit status 0
diff -r 588363ff1955 -r 16094db3680e usr.bin/make/unit-tests/sysv.mk
--- a/usr.bin/make/unit-tests/sysv.mk Sun Jul 19 14:05:39 2020 +0000
+++ b/usr.bin/make/unit-tests/sysv.mk Sun Jul 19 14:23:02 2020 +0000
@@ -1,4 +1,6 @@
-# $Id: sysv.mk,v 1.5 2020/07/03 19:29:25 rillig Exp $
+# $Id: sysv.mk,v 1.6 2020/07/19 14:23:02 rillig Exp $
+
+all: foo fun sam bla words ampersand
FOO ?=
FOOBAR = ${FOO:=bar}
@@ -11,8 +13,6 @@
SUN = the Sun
# we expect nothing when FOO is empty
-all: foo fun sam bla words
-
foo:
@echo FOOBAR = ${FOOBAR}
.if empty(FOO)
@@ -46,3 +46,11 @@
# It is part of the replacement string.
words:
@echo a${a b c d e:L:%a=x:Q}b
+
+# As of 2020-07-19, an ampersand can be used in the replacement part
+# of a SysV substitution modifier. This can either be an intentional
+# feature or an implementation mistake, as it is not mentioned in the
+# manual page.
+ampersand:
+ @echo ${:U${a.bcd.e:L:a.%=%}:Q}
+ @echo ${:U${a.bcd.e:L:a.%=&}:Q}
Home |
Main Index |
Thread Index |
Old Index