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): move tests for the :tu and ...
details: https://anonhg.NetBSD.org/src/rev/bd3f05339b8a
branches: trunk
changeset: 975214:bd3f05339b8a
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Aug 23 15:18:43 2020 +0000
description:
make(1): move tests for the :tu and :_ modifiers into separate files
diffstat:
usr.bin/make/unit-tests/modmisc.exp | 3 ---
usr.bin/make/unit-tests/modmisc.mk | 17 +----------------
usr.bin/make/unit-tests/varmod-remember.exp | 2 ++
usr.bin/make/unit-tests/varmod-remember.mk | 11 +++++++----
usr.bin/make/unit-tests/varmod-to-upper.exp | 1 +
usr.bin/make/unit-tests/varmod-to-upper.mk | 10 +++++-----
6 files changed, 16 insertions(+), 28 deletions(-)
diffs (113 lines):
diff -r 3a58c6d724c6 -r bd3f05339b8a usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp Sun Aug 23 15:13:21 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp Sun Aug 23 15:18:43 2020 +0000
@@ -14,11 +14,8 @@
S:empty
C:empty
@:
-mod-tu-space: A B
mod-quote: new
line
mod-break-many-words: 500
-mod-remember: 1 2 3 1 2 3 1 2 3
-mod-remember: 1 2 3, SAVED=3
exit status 0
diff -r 3a58c6d724c6 -r bd3f05339b8a usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk Sun Aug 23 15:13:21 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk Sun Aug 23 15:18:43 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.45 2020/08/23 15:13:21 rillig Exp $
+# $Id: modmisc.mk,v 1.46 2020/08/23 15:18:43 rillig Exp $
#
# miscellaneous modifier tests
@@ -16,10 +16,8 @@
MOD_SEP=S,:, ,g
all: modvar modvarloop modsysv emptyvar undefvar
-all: mod-tu-space
all: mod-quote
all: mod-break-many-words
-all: mod-remember
# See also sysv.mk.
modsysv:
@@ -58,11 +56,6 @@
@echo C:${:U:C,^$,empty,}
@echo @:${:U:@var@empty@}
-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}
mod-quote:
@echo $@: new${.newline:Q}${.newline:Q}line
@@ -71,14 +64,6 @@
mod-break-many-words:
@echo $@: ${UNDEF:U:range=500:[#]}
-# Demonstrate the :_ modifier.
-# In the parameterized form, having the variable name on the right side
-# of the = assignment operator is confusing. Luckily this modifier is
-# only rarely needed.
-mod-remember:
- @echo $@: ${1 2 3:L:_:@var@${_}@}
- @echo $@: ${1 2 3:L:@var@${var:_=SAVED:}@}, SAVED=${SAVED}
-
# To apply a modifier indirectly via another variable, the whole
# modifier must be put into a single variable.
.if ${value:L:${:US}${:U,value,replacement,}} != "S,value,replacement,}"
diff -r 3a58c6d724c6 -r bd3f05339b8a usr.bin/make/unit-tests/varmod-remember.exp
--- a/usr.bin/make/unit-tests/varmod-remember.exp Sun Aug 23 15:13:21 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-remember.exp Sun Aug 23 15:18:43 2020 +0000
@@ -1,1 +1,3 @@
+1 2 3 1 2 3 1 2 3
+1 2 3, SAVED=3
exit status 0
diff -r 3a58c6d724c6 -r bd3f05339b8a usr.bin/make/unit-tests/varmod-remember.mk
--- a/usr.bin/make/unit-tests/varmod-remember.mk Sun Aug 23 15:13:21 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-remember.mk Sun Aug 23 15:18:43 2020 +0000
@@ -1,9 +1,12 @@
-# $NetBSD: varmod-remember.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-remember.mk,v 1.3 2020/08/23 15:18:43 rillig Exp $
#
# Tests for the :_ modifier, which saves the current variable value
# in the _ variable or another, to be used later again.
-# TODO: Implementation
-
+# In the parameterized form, having the variable name on the right side of
+# the = assignment operator is confusing. In almost all other situations
+# the variable name is on the left-hand side of the = operator. Luckily
+# this modifier is only rarely needed.
all:
- @:;
+ @echo ${1 2 3:L:_:@var@${_}@}
+ @echo ${1 2 3:L:@var@${var:_=SAVED:}@}, SAVED=${SAVED}
diff -r 3a58c6d724c6 -r bd3f05339b8a usr.bin/make/unit-tests/varmod-to-upper.exp
--- a/usr.bin/make/unit-tests/varmod-to-upper.exp Sun Aug 23 15:13:21 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-to-upper.exp Sun Aug 23 15:18:43 2020 +0000
@@ -1,1 +1,2 @@
+mod-tu-space: A B
exit status 0
diff -r 3a58c6d724c6 -r bd3f05339b8a usr.bin/make/unit-tests/varmod-to-upper.mk
--- a/usr.bin/make/unit-tests/varmod-to-upper.mk Sun Aug 23 15:13:21 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-to-upper.mk Sun Aug 23 15:18:43 2020 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: varmod-to-upper.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-to-upper.mk,v 1.3 2020/08/23 15:18:43 rillig Exp $
#
# Tests for the :tu variable modifier, which returns the words in the
# variable value, converted to uppercase.
-# TODO: Implementation
-
-all:
- @:;
+# 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.
+mod-tu-space:
+ @echo $@: ${a b:L:tu:Q}
Home |
Main Index |
Thread Index |
Old Index