Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Re: (Y) modifier: up to N matches?



On Jun 6,  2:45am, Daniel Shahaf wrote:
} Subject: Re: [PATCH] Re: (Y) modifier: up to N matches?
}
}     % mkdir -p A/B/foo A/foo
}     % echo **/foo(Y1)
}     A/foo
} 
} It may be worthwhile adding a unit test for this to Test/D02glob to
} ensure this behaviour doesn't change.

I think the existing tests of **/ would fail if this changed, so yet
another test is probably not necessary, but if wanted:

diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 358c934..a40e154 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -550,6 +550,7 @@
  (){ print "Negated:" $@:t } glob.tmp/dir*(Y1^Y)
  (){ print "Sorting:" $@:t } glob.tmp/dir*(Y4On)
  (){ [[ $#@ -eq 1 ]] && print Globs before last path component } glob.tmp/dir?/subdir(NY1)
+ (){ [[ $1 == glob.tmp/a ]] } glob.tmp/**/a(Y1) && print Breadth first
  (){ [[ $#@ -eq 0 ]] && print Respects qualifiers } glob.tmp/dir*(NY1.)
  (print -- *(Y)) 2>/dev/null || print "Argument required"
 0:short-circuit modifier
@@ -560,5 +561,6 @@
 >Negated: dir1 dir2 dir3 dir4
 >Sorting: dir4 dir3 dir2 dir1
 >Globs before last path component
+>Breadth first
 >Respects qualifiers
 >Argument required



Messages sorted by: Reverse Date, Date, Thread, Author