@@ -176,4 +176,44 @@ func TestReadDirRecursiveFiltered(t *testing.T) {
176
176
pathEqualsTo (t , "_testdata/symlinktofolder/subfolder" , l [9 ]) // <- subfolder skipped by Prefix("sub")
177
177
pathEqualsTo (t , "_testdata/test.txt" , l [10 ])
178
178
pathEqualsTo (t , "_testdata/test.txt.gz" , l [11 ])
179
+
180
+ l , err = testdata .ReadDirRecursiveFiltered (FilterOutPrefixes ("sub" ), AndFilter (FilterOutSuffixes ("3" ), FilterOutPrefixes ("fil" )))
181
+ require .NoError (t , err )
182
+ l .Sort ()
183
+ pathEqualsTo (t , "_testdata/anotherFile" , l [0 ])
184
+ pathEqualsTo (t , "_testdata/folder" , l [1 ])
185
+ pathEqualsTo (t , "_testdata/folder/.hidden" , l [2 ])
186
+ pathEqualsTo (t , "_testdata/folder/subfolder" , l [3 ])
187
+ pathEqualsTo (t , "_testdata/symlinktofolder" , l [4 ])
188
+ pathEqualsTo (t , "_testdata/symlinktofolder/.hidden" , l [5 ])
189
+ pathEqualsTo (t , "_testdata/symlinktofolder/subfolder" , l [6 ])
190
+ pathEqualsTo (t , "_testdata/test.txt" , l [7 ])
191
+ pathEqualsTo (t , "_testdata/test.txt.gz" , l [8 ])
192
+
193
+ l , err = testdata .ReadDirRecursiveFiltered (FilterOutPrefixes ("sub" ), AndFilter (FilterOutSuffixes ("3" ), FilterOutPrefixes ("fil" ), FilterOutSuffixes (".gz" )))
194
+ require .NoError (t , err )
195
+ l .Sort ()
196
+ pathEqualsTo (t , "_testdata/anotherFile" , l [0 ])
197
+ pathEqualsTo (t , "_testdata/folder" , l [1 ])
198
+ pathEqualsTo (t , "_testdata/folder/.hidden" , l [2 ])
199
+ pathEqualsTo (t , "_testdata/folder/subfolder" , l [3 ])
200
+ pathEqualsTo (t , "_testdata/symlinktofolder" , l [4 ])
201
+ pathEqualsTo (t , "_testdata/symlinktofolder/.hidden" , l [5 ])
202
+ pathEqualsTo (t , "_testdata/symlinktofolder/subfolder" , l [6 ])
203
+ pathEqualsTo (t , "_testdata/test.txt" , l [7 ])
204
+
205
+ l , err = testdata .ReadDirRecursiveFiltered (OrFilter (FilterPrefixes ("sub" ), FilterSuffixes ("tofolder" )))
206
+ require .NoError (t , err )
207
+ l .Sort ()
208
+ pathEqualsTo (t , "_testdata/anotherFile" , l [0 ])
209
+ pathEqualsTo (t , "_testdata/file" , l [1 ])
210
+ pathEqualsTo (t , "_testdata/folder" , l [2 ])
211
+ pathEqualsTo (t , "_testdata/symlinktofolder" , l [3 ])
212
+ pathEqualsTo (t , "_testdata/symlinktofolder/.hidden" , l [4 ])
213
+ pathEqualsTo (t , "_testdata/symlinktofolder/file2" , l [5 ])
214
+ pathEqualsTo (t , "_testdata/symlinktofolder/file3" , l [6 ])
215
+ pathEqualsTo (t , "_testdata/symlinktofolder/subfolder" , l [7 ])
216
+ pathEqualsTo (t , "_testdata/symlinktofolder/subfolder/file4" , l [8 ])
217
+ pathEqualsTo (t , "_testdata/test.txt" , l [9 ])
218
+ pathEqualsTo (t , "_testdata/test.txt.gz" , l [10 ])
179
219
}
0 commit comments