aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/varmod-root.mk
diff options
context:
space:
mode:
Diffstat (limited to 'unit-tests/varmod-root.mk')
-rw-r--r--unit-tests/varmod-root.mk37
1 files changed, 33 insertions, 4 deletions
diff --git a/unit-tests/varmod-root.mk b/unit-tests/varmod-root.mk
index 1e3159733df0..cf88491df799 100644
--- a/unit-tests/varmod-root.mk
+++ b/unit-tests/varmod-root.mk
@@ -1,9 +1,38 @@
-# $NetBSD: varmod-root.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $
+# $NetBSD: varmod-root.mk,v 1.5 2021/12/05 22:31:58 rillig Exp $
#
# Tests for the :R variable modifier, which returns the filename root
# without the extension.
+.if ${a/b/c:L:R} != "a/b/c"
+. error
+.endif
+
+.if ${def:L:R} != "def"
+. error
+.endif
+
+.if ${a.b.c:L:R} != "a.b"
+. error
+.endif
+
+.if ${a.b/c:L:R} != "a"
+. error
+.endif
+
+.if ${a:L:R} != "a"
+. error
+.endif
+
+.if ${a.a:L:R} != "a"
+. error
+.endif
+
+.if ${.gitignore:L:R} != ""
+. error
+.endif
+
+.if ${trailing/:L:R} != "trailing/"
+. error
+.endif
+
all:
-.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/
- @echo "root of '"${path:Q}"' is '"${path:R:Q}"'"
-.endfor