Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): add more tests for :H, :T a...



details:   https://anonhg.NetBSD.org/src/rev/f9b9ff5b62ca
branches:  trunk
changeset: 1011562:f9b9ff5b62ca
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jul 03 15:33:01 2020 +0000

description:
make(1): add more tests for :H, :T and :E modifiers

diffstat:

 usr.bin/make/unit-tests/modmisc.exp |   5 +++--
 usr.bin/make/unit-tests/modmisc.mk  |  12 +++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r 117811e0e1f7 -r f9b9ff5b62ca usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp       Fri Jul 03 15:31:25 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp       Fri Jul 03 15:33:01 2020 +0000
@@ -7,6 +7,7 @@
 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
diff -r 117811e0e1f7 -r f9b9ff5b62ca usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk        Fri Jul 03 15:31:25 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk        Fri Jul 03 15:33:01 2020 +0000
@@ -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_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 @@
        @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}



Home | Main Index | Thread Index | Old Index