Module Name: src Committed By: rillig Date: Sun Dec 5 22:31:58 UTC 2021
Modified Files: src/usr.bin/make/unit-tests: varmod-root.exp varmod-root.mk Log Message: tests/make: split test cases for ':R' into separate tests This allows to comment or explain individual test cases. Remove duplicates. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-root.exp cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/varmod-root.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-root.exp diff -u src/usr.bin/make/unit-tests/varmod-root.exp:1.3 src/usr.bin/make/unit-tests/varmod-root.exp:1.4 --- src/usr.bin/make/unit-tests/varmod-root.exp:1.3 Sun Dec 20 22:57:40 2020 +++ src/usr.bin/make/unit-tests/varmod-root.exp Sun Dec 5 22:31:58 2021 @@ -1,11 +1 @@ -root of 'a/b/c' is 'a/b/c' -root of 'def' is 'def' -root of 'a.b.c' is 'a.b' -root of 'a.b/c' is 'a' -root of 'a' is 'a' -root of 'a.a' is 'a' -root of '.gitignore' is '' -root of 'a' is 'a' -root of 'a.a' is 'a' -root of 'trailing/' is 'trailing/' exit status 0 Index: src/usr.bin/make/unit-tests/varmod-root.mk diff -u src/usr.bin/make/unit-tests/varmod-root.mk:1.4 src/usr.bin/make/unit-tests/varmod-root.mk:1.5 --- src/usr.bin/make/unit-tests/varmod-root.mk:1.4 Sun Dec 20 22:57:40 2020 +++ src/usr.bin/make/unit-tests/varmod-root.mk Sun Dec 5 22:31:58 2021 @@ -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