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 :tu modifier w...



details:   https://anonhg.NetBSD.org/src/rev/b04ad2f7576a
branches:  trunk
changeset: 974022:b04ad2f7576a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 20 16:12:02 2020 +0000

description:
make(1): add test for :tu modifier with spaces

diffstat:

 usr.bin/make/unit-tests/modmisc.exp |  1 +
 usr.bin/make/unit-tests/modmisc.mk  |  9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r 4242f088e3cf -r b04ad2f7576a usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp       Mon Jul 20 15:48:50 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp       Mon Jul 20 16:12:02 2020 +0000
@@ -78,4 +78,5 @@
 3
 mod-assign: ran:3.
 mod-assign: global: 1, 3, 1 2 3, 3.
+mod-tu-space: A   B
 exit status 0
diff -r 4242f088e3cf -r b04ad2f7576a usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk        Mon Jul 20 15:48:50 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk        Mon Jul 20 16:12:02 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.16 2020/07/19 20:49:44 rillig Exp $
+# $Id: modmisc.mk,v 1.17 2020/07/20 16:12:02 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -20,6 +20,7 @@
 all:   mod-subst-dollar mod-loop-dollar
 all:   mod-C-limits
 all:   mod-assign
+all:   mod-tu-space
 
 modsysv:
        @echo "The answer is ${libfoo.a:L:libfoo.a=42}"
@@ -156,3 +157,9 @@
        # The assignments happen in the global scope and thus are
        # preserved even after the shell command has been run.
        @echo $@: global: ${FIRST:Q}, ${LAST:Q}, ${APPENDED:Q}, ${RAN:Q}.
+
+mod-tu-space:
+       # The :tu and :tl modifiers operate on the variable value
+       # as a single string, not as a list of words. Therefore,
+       # the adjacent spaces are preserved.
+       @echo $@: ${a   b:L:tu:Q}



Home | Main Index | Thread Index | Old Index