Module Name: src
Committed By: rillig
Date: Fri Aug 28 17:21:03 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: varmod-to-lower.mk varmod-to-upper.mk
Log Message:
make(1): add tests for :tl and :tu modifiers
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-to-lower.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-to-upper.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/varmod-to-lower.mk
diff -u src/usr.bin/make/unit-tests/varmod-to-lower.mk:1.2 src/usr.bin/make/unit-tests/varmod-to-lower.mk:1.3
--- src/usr.bin/make/unit-tests/varmod-to-lower.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/varmod-to-lower.mk Fri Aug 28 17:21:02 2020
@@ -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:
@:;
Index: src/usr.bin/make/unit-tests/varmod-to-upper.mk
diff -u src/usr.bin/make/unit-tests/varmod-to-upper.mk:1.3 src/usr.bin/make/unit-tests/varmod-to-upper.mk:1.4
--- src/usr.bin/make/unit-tests/varmod-to-upper.mk:1.3 Sun Aug 23 15:18:43 2020
+++ src/usr.bin/make/unit-tests/varmod-to-upper.mk Fri Aug 28 17:21:02 2020
@@ -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: