make(1): add tests for variable modifiers on trailing slashesdiff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-extension.exp
(rillig)
--- src/usr.bin/make/unit-tests/varmod-extension.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-extension.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ | @@ -1,10 +1,11 @@ | |||
1 | extension of 'a/b/c' is '' | 1 | extension of 'a/b/c' is '' | |
2 | extension of 'def' is '' | 2 | extension of 'def' is '' | |
3 | extension of 'a.b.c' is 'c' | 3 | extension of 'a.b.c' is 'c' | |
4 | extension of 'a.b/c' is 'b/c' | 4 | extension of 'a.b/c' is 'b/c' | |
5 | extension of 'a' is '' | 5 | extension of 'a' is '' | |
6 | extension of 'a.a' is 'a' | 6 | extension of 'a.a' is 'a' | |
7 | extension of '.gitignore' is 'gitignore' | 7 | extension of '.gitignore' is 'gitignore' | |
8 | extension of 'a' is '' | 8 | extension of 'a' is '' | |
9 | extension of 'a.a' is 'a' | 9 | extension of 'a.a' is 'a' | |
10 | extension of 'trailing/' is '' | |||
10 | exit status 0 | 11 | exit status 0 |
--- src/usr.bin/make/unit-tests/varmod-head.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-head.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ | @@ -1,10 +1,11 @@ | |||
1 | head (dirname) of 'a/b/c' is 'a/b' | 1 | head (dirname) of 'a/b/c' is 'a/b' | |
2 | head (dirname) of 'def' is '.' | 2 | head (dirname) of 'def' is '.' | |
3 | head (dirname) of 'a.b.c' is '.' | 3 | head (dirname) of 'a.b.c' is '.' | |
4 | head (dirname) of 'a.b/c' is 'a.b' | 4 | head (dirname) of 'a.b/c' is 'a.b' | |
5 | head (dirname) of 'a' is '.' | 5 | head (dirname) of 'a' is '.' | |
6 | head (dirname) of 'a.a' is '.' | 6 | head (dirname) of 'a.a' is '.' | |
7 | head (dirname) of '.gitignore' is '.' | 7 | head (dirname) of '.gitignore' is '.' | |
8 | head (dirname) of 'a' is '.' | 8 | head (dirname) of 'a' is '.' | |
9 | head (dirname) of 'a.a' is '.' | 9 | head (dirname) of 'a.a' is '.' | |
10 | head (dirname) of 'trailing/' is 'trailing' | |||
10 | exit status 0 | 11 | exit status 0 |
--- src/usr.bin/make/unit-tests/varmod-root.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-root.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ | @@ -1,10 +1,11 @@ | |||
1 | root of 'a/b/c' is 'a/b/c' | 1 | root of 'a/b/c' is 'a/b/c' | |
2 | root of 'def' is 'def' | 2 | root of 'def' is 'def' | |
3 | root of 'a.b.c' is 'a.b' | 3 | root of 'a.b.c' is 'a.b' | |
4 | root of 'a.b/c' is 'a' | 4 | root of 'a.b/c' is 'a' | |
5 | root of 'a' is 'a' | 5 | root of 'a' is 'a' | |
6 | root of 'a.a' is 'a' | 6 | root of 'a.a' is 'a' | |
7 | root of '.gitignore' is '' | 7 | root of '.gitignore' is '' | |
8 | root of 'a' is 'a' | 8 | root of 'a' is 'a' | |
9 | root of 'a.a' is 'a' | 9 | root of 'a.a' is 'a' | |
10 | root of 'trailing/' is 'trailing/' | |||
10 | exit status 0 | 11 | exit status 0 |
--- src/usr.bin/make/unit-tests/varmod-tail.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-tail.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ | @@ -1,10 +1,11 @@ | |||
1 | tail (basename) of 'a/b/c' is 'c' | 1 | tail (basename) of 'a/b/c' is 'c' | |
2 | tail (basename) of 'def' is 'def' | 2 | tail (basename) of 'def' is 'def' | |
3 | tail (basename) of 'a.b.c' is 'a.b.c' | 3 | tail (basename) of 'a.b.c' is 'a.b.c' | |
4 | tail (basename) of 'a.b/c' is 'c' | 4 | tail (basename) of 'a.b/c' is 'c' | |
5 | tail (basename) of 'a' is 'a' | 5 | tail (basename) of 'a' is 'a' | |
6 | tail (basename) of 'a.a' is 'a.a' | 6 | tail (basename) of 'a.a' is 'a.a' | |
7 | tail (basename) of '.gitignore' is '.gitignore' | 7 | tail (basename) of '.gitignore' is '.gitignore' | |
8 | tail (basename) of 'a' is 'a' | 8 | tail (basename) of 'a' is 'a' | |
9 | tail (basename) of 'a.a' is 'a.a' | 9 | tail (basename) of 'a.a' is 'a.a' | |
10 | tail (basename) of 'trailing/' is '' | |||
10 | exit status 0 | 11 | exit status 0 |
--- src/usr.bin/make/unit-tests/varmod-extension.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-extension.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ | @@ -1,9 +1,9 @@ | |||
1 | # $NetBSD: varmod-extension.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ | 1 | # $NetBSD: varmod-extension.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $ | |
2 | # | 2 | # | |
3 | # Tests for the :E variable modifier, which returns the filename extension | 3 | # Tests for the :E variable modifier, which returns the filename extension | |
4 | # of each word in the variable. | 4 | # of each word in the variable. | |
5 | 5 | |||
6 | all: | 6 | all: | |
7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a | 7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/ | |
8 | @echo "extension of '"${path:Q}"' is '"${path:E:Q}"'" | 8 | @echo "extension of '"${path:Q}"' is '"${path:E:Q}"'" | |
9 | .endfor | 9 | .endfor |
--- src/usr.bin/make/unit-tests/varmod-head.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-head.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ | @@ -1,9 +1,9 @@ | |||
1 | # $NetBSD: varmod-head.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ | 1 | # $NetBSD: varmod-head.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $ | |
2 | # | 2 | # | |
3 | # Tests for the :H variable modifier, which returns the dirname of | 3 | # Tests for the :H variable modifier, which returns the dirname of | |
4 | # each of the words in the variable value. | 4 | # each of the words in the variable value. | |
5 | 5 | |||
6 | all: | 6 | all: | |
7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a | 7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/ | |
8 | @echo "head (dirname) of '"${path:Q}"' is '"${path:H:Q}"'" | 8 | @echo "head (dirname) of '"${path:Q}"' is '"${path:H:Q}"'" | |
9 | .endfor | 9 | .endfor |
--- src/usr.bin/make/unit-tests/varmod-root.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-root.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ | @@ -1,9 +1,9 @@ | |||
1 | # $NetBSD: varmod-root.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ | 1 | # $NetBSD: varmod-root.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $ | |
2 | # | 2 | # | |
3 | # Tests for the :R variable modifier, which returns the filename root | 3 | # Tests for the :R variable modifier, which returns the filename root | |
4 | # without the extension. | 4 | # without the extension. | |
5 | 5 | |||
6 | all: | 6 | all: | |
7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a | 7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/ | |
8 | @echo "root of '"${path:Q}"' is '"${path:R:Q}"'" | 8 | @echo "root of '"${path:Q}"' is '"${path:R:Q}"'" | |
9 | .endfor | 9 | .endfor |
--- src/usr.bin/make/unit-tests/varmod-tail.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-tail.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ | @@ -1,9 +1,9 @@ | |||
1 | # $NetBSD: varmod-tail.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ | 1 | # $NetBSD: varmod-tail.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $ | |
2 | # | 2 | # | |
3 | # Tests for the :T variable modifier, which returns the basename of each of | 3 | # Tests for the :T variable modifier, which returns the basename of each of | |
4 | # the words in the variable value. | 4 | # the words in the variable value. | |
5 | 5 | |||
6 | all: | 6 | all: | |
7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a | 7 | .for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/ | |
8 | @echo "tail (basename) of '"${path:Q}"' is '"${path:T:Q}"'" | 8 | @echo "tail (basename) of '"${path:Q}"' is '"${path:T:Q}"'" | |
9 | .endfor | 9 | .endfor |