From 8bc2de1911e232faf58bcb353c6eb173e47ba8c8 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 30 Dec 2024 23:34:08 +0200 Subject: Fix parser::parse_names() which fails on pattern inclusion groups for some corner cases Specifically, fix the function for the case when the pattern inclusion group is specified first in the pattern group in a directory. For example, before the fix, compiling the following buildfile: fs = hello exe{hello}: foo/{hxx ixx txx cxx}{+{$fs}} would fail with the following error: invalid 'foo/hello' in name pattern --- tests/name/pattern.testscript | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/name/pattern.testscript b/tests/name/pattern.testscript index c1a4ce4..efd15b2 100644 --- a/tests/name/pattern.testscript +++ b/tests/name/pattern.testscript @@ -153,6 +153,9 @@ EOI mkdir bar; $* <'print {f*/ +{b*/}}' >/'bar/' : include-group + mkdir -p foo/bar; + $* <'print $path.canonicalize(foo/{+{b*/}})' >/'foo/bar/' : include-group-first + touch foo.txt fox.txt; $* <'print {*.txt -f*.txt +*x.txt}' >'fox.txt' : include-exclude-order @@ -309,6 +312,15 @@ EOI print {+{$pats}} EOI + : pattern-via-expansion-list-subdir + : + mkdir baz; + touch baz/foo.txt baz/bar.hxx; + $* <'baz/bar.hxx baz/foo.txt' + pats = '*.hxx' '*.txt' + print baz/{+{$pats}} + EOI + : pattern-via-expansion-type : touch foo.txt; -- cgit v1.1