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 tests for :tl and :tu m...



details:   https://anonhg.NetBSD.org/src/rev/bf0098081473
branches:  trunk
changeset: 937903:bf0098081473
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Aug 28 17:21:02 2020 +0000

description:
make(1): add tests for :tl and :tu modifiers

diffstat:

 usr.bin/make/unit-tests/varmod-to-lower.mk |  14 ++++++++++++--
 usr.bin/make/unit-tests/varmod-to-upper.mk |  14 +++++++++++++-
 2 files changed, 25 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r 6c5b54d183bf -r bf0098081473 usr.bin/make/unit-tests/varmod-to-lower.mk
--- a/usr.bin/make/unit-tests/varmod-to-lower.mk        Fri Aug 28 17:17:53 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-to-lower.mk        Fri Aug 28 17:21:02 2020 +0000
@@ -1,9 +1,19 @@
-# $NetBSD: varmod-to-lower.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-to-lower.mk,v 1.3 2020/08/28 17:21:02 rillig Exp $
 #
 # Tests for the :tl variable modifier, which returns the words in the
 # variable value, converted to lowercase.
 
-# TODO: Implementation
+.if ${:UUPPER:tl} != "upper"
+.error
+.endif
+
+.if ${:Ulower:tl} != "lower"
+.error
+.endif
+
+.if ${:UMixeD case.:tl} != "mixed case."
+.error
+.endif
 
 all:
        @:;
diff -r 6c5b54d183bf -r bf0098081473 usr.bin/make/unit-tests/varmod-to-upper.mk
--- a/usr.bin/make/unit-tests/varmod-to-upper.mk        Fri Aug 28 17:17:53 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-to-upper.mk        Fri Aug 28 17:21:02 2020 +0000
@@ -1,8 +1,20 @@
-# $NetBSD: varmod-to-upper.mk,v 1.3 2020/08/23 15:18:43 rillig Exp $
+# $NetBSD: varmod-to-upper.mk,v 1.4 2020/08/28 17:21:02 rillig Exp $
 #
 # Tests for the :tu variable modifier, which returns the words in the
 # variable value, converted to uppercase.
 
+.if ${:UUPPER:tu} != "UPPER"
+.error
+.endif
+
+.if ${:Ulower:tu} != "LOWER"
+.error
+.endif
+
+.if ${:UMixeD case.:tu} != "MIXED CASE."
+.error
+.endif
+
 # 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:



Home | Main Index | Thread Index | Old Index