@@ -361,6 +361,72 @@ public void testFilterProjectFiles_dest() {
361
361
assertThat (actual , containsInAnyOrder (expected ));
362
362
}
363
363
364
+ @ ParameterizedTest
365
+ @ MethodSource
366
+ @ DisabledOnOs ({OS .LINUX , OS .MAC })
367
+ public void testFilterProjectFiles_escapeSymbols_windows (List <String > filePaths , String sourcePattern , List <String > expected ) {
368
+ List <String > actual = SourcesUtils .filterProjectFiles (
369
+ filePaths , sourcePattern , Collections .emptyList (), true , PlaceholderUtilBuilder .STANDART .build ("" ));
370
+ assertEquals (expected .size (), actual .size ());
371
+ assertThat (actual , containsInAnyOrder (expected .toArray ()));
372
+ }
373
+
374
+ static Stream <Arguments > testFilterProjectFiles_escapeSymbols_windows () {
375
+ String file1 = "file?1.po" ;
376
+ String file2Here = "here\\ file*2.po" ;
377
+ String file3There = "here\\ there\\ file.3.po" ;
378
+ return Stream .of (
379
+ arguments (
380
+ Arrays .asList (file1 , file2Here , file3There ),
381
+ "file^?1.po" ,
382
+ Arrays .asList (file1 )
383
+ ),
384
+ arguments (
385
+ Arrays .asList (file1 , file2Here , file3There ),
386
+ "here\\ file^*2.po" ,
387
+ Arrays .asList (file2Here )
388
+ ),
389
+ arguments (
390
+ Arrays .asList (file1 , file2Here , file3There ),
391
+ "here\\ there\\ file^.3.po" ,
392
+ Arrays .asList (file3There )
393
+ )
394
+ );
395
+ }
396
+
397
+ @ ParameterizedTest
398
+ @ MethodSource
399
+ @ DisabledOnOs ({OS .WINDOWS })
400
+ public void testFilterProjectFiles_escapeSymbols_unix (List <String > filePaths , String sourcePattern , List <String > expected ) {
401
+ List <String > actual = SourcesUtils .filterProjectFiles (
402
+ filePaths , sourcePattern , Collections .emptyList (), true , PlaceholderUtilBuilder .STANDART .build ("" ));
403
+ assertEquals (expected .size (), actual .size ());
404
+ assertThat (actual , containsInAnyOrder (expected .toArray ()));
405
+ }
406
+
407
+ static Stream <Arguments > testFilterProjectFiles_escapeSymbols_unix () {
408
+ String file1 = "file?1.po" ;
409
+ String file2Here = "here/file*2.po" ;
410
+ String file3There = "here/there/file.3.po" ;
411
+ return Stream .of (
412
+ arguments (
413
+ Arrays .asList (file1 , file2Here , file3There ),
414
+ "file\\ ?1.po" ,
415
+ Arrays .asList (file1 )
416
+ ),
417
+ arguments (
418
+ Arrays .asList (file1 , file2Here , file3There ),
419
+ "here/file\\ *2.po" ,
420
+ Arrays .asList (file2Here )
421
+ ),
422
+ arguments (
423
+ Arrays .asList (file1 , file2Here , file3There ),
424
+ "here/there/file\\ .3.po" ,
425
+ Arrays .asList (file3There )
426
+ )
427
+ );
428
+ }
429
+
364
430
@ ParameterizedTest
365
431
@ MethodSource
366
432
public void testContainsParameter (String sourcePattern , boolean expected ) {
0 commit comments