Module Name: src
Committed By: rillig
Date: Fri Jul 3 15:33:01 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk
Log Message:
make(1): add more tests for :H, :T and :E modifiers
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/modmisc.exp \
src/usr.bin/make/unit-tests/modmisc.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/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.3 src/usr.bin/make/unit-tests/modmisc.exp:1.4
--- src/usr.bin/make/unit-tests/modmisc.exp:1.3 Fri Jul 3 15:22:35 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp Fri Jul 3 15:33:01 2020
@@ -7,6 +7,7 @@ path_/usr/xbin=/opt/xbin/
paths=/bin /tmp / /no/such/dir /opt/xbin
PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN
The answer is 42
-head of 'a/b/c def' is 'a/b .'
-tail of 'a/b/c def' is 'c def'
+head of 'a/b/c def archive.tar.gz conf.d/file' is 'a/b . . conf.d
+tail of 'a/b/c def archive.tar.gz conf.d/file' is 'c def archive.tar.gz file
+suffix of 'a/b/c def archive.tar.gz conf.d/file' is 'gz d/file
exit status 0
Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.3 src/usr.bin/make/unit-tests/modmisc.mk:1.4
--- src/usr.bin/make/unit-tests/modmisc.mk:1.3 Fri Jul 3 15:22:35 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk Fri Jul 3 15:33:01 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.3 2020/07/03 15:22:35 rillig Exp $
+# $Id: modmisc.mk,v 1.4 2020/07/03 15:33:01 rillig Exp $
#
# miscellaneous modifier tests
@@ -15,7 +15,7 @@ MOD_HOMES=S,/home/,/homes/,
MOD_OPT=@d@$${exists($$d):?$$d:$${d:S,/usr,/opt,}}@
MOD_SEP=S,:, ,g
-all: modvar modvarloop modsysv modhead
+all: modvar modvarloop modsysv mod-HTE
modsysv:
@echo "The answer is ${libfoo.a:L:libfoo.a=42}"
@@ -37,6 +37,8 @@ modvarloop:
@echo "paths=${paths}"
@echo "PATHS=${paths:tu}"
-modhead:
- @echo "head of 'a/b/c def' is '${a/b/c def:L:H}'"
- @echo "tail of 'a/b/c def' is '${a/b/c def:L:T}'"
+PATHNAMES= a/b/c def archive.tar.gz conf.d/file
+mod-HTE:
+ @echo "head of '"${PATHNAMES:Q}"' is '"${PATHNAMES:H:Q}
+ @echo "tail of '"${PATHNAMES:Q}"' is '"${PATHNAMES:T:Q}
+ @echo "suffix of '"${PATHNAMES:Q}"' is '"${PATHNAMES:E:Q}