From 49531f69ed251f0caf030e19afbf6a0fd1868aa6 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 1 Dec 2018 19:35:43 +0300 Subject: Change path_search() to only match directory absent components in 'match absent' mode --- tests/wildcard/testscript | 134 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 105 insertions(+), 29 deletions(-) (limited to 'tests') diff --git a/tests/wildcard/testscript b/tests/wildcard/testscript index 885a7d5..bc90468 100644 --- a/tests/wildcard/testscript +++ b/tests/wildcard/testscript @@ -1154,7 +1154,7 @@ : ignorable-components : { - test.options += -i + test.options += -i -n : middle : @@ -1164,25 +1164,58 @@ $* a/**/b a/b >/ a/b $* a/**/b a/x/b >/ a/x/b - $* a/***/b a/b >>/EOE + $* a/***/b a/b >>/EOO a/b a/b - EOE + EOO + + : multiple + : + { + $* a/**/*/b a/b >/ a/b + + $* a/**/*/b a/x/b >>/EOO + a/x/b + a/x/b + EOO + } } : top-level : if ($cxx.target.class != 'windows') { - $* -n /*/a /a > /a - $* -n /*/a /b/a > /b/a + $* /*/a /a > /a + $* /*/a /b/a > /b/a + + : multiple + : + { + $* /*/*/a /a > /a + + $* /*/*/a /b/a >>EOO + /b/a + /b/a + EOO + } } : leading : { - $* -n */a a >/ a - $* -n */a b/a >/ b/a + $* */a a >/ a + $* */a b/a >/ b/a + + : multiple + : + { + $* */*/a a >/ a + + $* */*/a b/a >>/EOO + b/a + b/a + EOO + } } : trailing @@ -1190,45 +1223,88 @@ { : file : + : Test that the pattern star-only component of the file type does not + : match an absent component. + : { - $* -n a/* a >/ a - $* -n a/* a/b >/ a/b + $* a/* a/b >/ a/b + + $* a/* a == 1 + $* a/* a/ == 1 + $* a/* a/b/ == 1 + + : multiple + : + { + $* a/*/* a/b >/ a/b - $* -n a/* a/ == 1 - $* -n a/* a/b/ == 1 + $* a/*/* a == 1 + $* a/*/* a/ == 1 + $* a/*/* a/b/ == 1 + } } : dir : { - $* -n a/*/ a/ >/ a/ - $* -n a/*/ a/b >/ a/ + $* a/*/ a/ >/ a/ + $* a/*/ a/b >/ a/ - $* -n a/*/ a/b/ >>/EOE + $* a/*/ a/b/ >>/EOO a/b/ a/ - EOE + EOO + + $* a/*/ a == 1 - $* -n a/*/ a == 1 + : multiple + : + { + $* a/*/*/ a/ >/ a/ + $* a/*/*/ a/b >/ a/ + + $* a/*/*/ a/b/ >>/EOO + a/b/ + a/b/ + a/ + EOO + + $* a/*/*/ a == 1 + } } } : leading-trailing { - $* -n */* a >/ a - $* -n */* a/b >/ a/b - - $* -n */a/* a >/ a - $* -n */a/* a/b >/ a/b - $* -n */a/* b/a >/ b/a - $* -n */a/* c/a/b >/ c/a/b - - $* -n **/a/** a >/ a - $* -n **/a/** a/b/c/d >/ a/b/c/d - $* -n **/a/** d/c/b/a >/ d/c/b/a - $* -n **/a/** d/c/b/a/b/c/d >/ d/c/b/a/b/c/d - } + : adjacent + : + { + $* */* a >/ a + $* */* a/b >/ a/b + + $* */* a/ == 1 + } + : apart + : + { + $* */a/* a/b >/ a/b + $* */a/* c/a/b >/ c/a/b + $* */a/* a == 1 + $* */a/* b/a == 1 + $* */a/* b/a/ == 1 + + : recursive + : + { + $* **/a/** a/b/c/d >/ a/b/c/d + $* **/a/** d/c/b/a/b/c/d >/ d/c/b/a/b/c/d + + $* **/a/** a == 1 + $* **/a/** d/c/b/a == 1 + } + } + } } } -- cgit v1.1