@@ -361,6 +361,90 @@ 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 = "here\\ file-1.po" ;
376
+ String file1Symbol = "here\\ file?1.po" ;
377
+ String file2 = "here\\ file-2.po" ;
378
+ String file2Symbol = "here\\ file*2.po" ;
379
+ String file3 = "here\\ file-3.po" ;
380
+ String file3Symbol = "here\\ file.3.po" ;
381
+ List <String > allFiles = Arrays .asList (file1 , file1Symbol , file2 , file2Symbol , file3 , file3Symbol );
382
+ return Stream .of (
383
+ arguments (
384
+ allFiles ,
385
+ "here\\ file^?1.po" ,
386
+ Arrays .asList (file1Symbol )
387
+ ),
388
+ arguments (
389
+ allFiles ,
390
+ "here\\ file^*2.po" ,
391
+ Arrays .asList (file2Symbol )
392
+ ),
393
+ arguments (
394
+ allFiles ,
395
+ "here\\ file^.3.po" ,
396
+ Arrays .asList (file3Symbol )
397
+ ),
398
+ arguments (
399
+ allFiles ,
400
+ "here\\ *.po" ,
401
+ allFiles
402
+ )
403
+ );
404
+ }
405
+
406
+ @ ParameterizedTest
407
+ @ MethodSource
408
+ @ DisabledOnOs (OS .WINDOWS )
409
+ public void testFilterProjectFiles_escapeSymbols_unix (List <String > filePaths , String sourcePattern , List <String > expected ) {
410
+ List <String > actual = SourcesUtils .filterProjectFiles (
411
+ filePaths , sourcePattern , Collections .emptyList (), true , PlaceholderUtilBuilder .STANDART .build ("" ));
412
+ assertEquals (expected .size (), actual .size ());
413
+ assertThat (actual , containsInAnyOrder (expected .toArray ()));
414
+ }
415
+
416
+ static Stream <Arguments > testFilterProjectFiles_escapeSymbols_unix () {
417
+ String file1 = "here/file-1.po" ;
418
+ String file1Symbol = "here/file?1.po" ;
419
+ String file2 = "here/file-2.po" ;
420
+ String file2Symbol = "here/file*2.po" ;
421
+ String file3 = "here/file-3.po" ;
422
+ String file3Symbol = "here/file.3.po" ;
423
+ List <String > allFiles = Arrays .asList (file1 , file1Symbol , file2 , file2Symbol , file3 , file3Symbol );
424
+ return Stream .of (
425
+ arguments (
426
+ allFiles ,
427
+ "here/file\\ ?1.po" ,
428
+ Arrays .asList (file1Symbol )
429
+ ),
430
+ arguments (
431
+ allFiles ,
432
+ "here/file\\ *2.po" ,
433
+ Arrays .asList (file2Symbol )
434
+ ),
435
+ arguments (
436
+ allFiles ,
437
+ "here/file\\ .3.po" ,
438
+ Arrays .asList (file3Symbol )
439
+ ),
440
+ arguments (
441
+ allFiles ,
442
+ "here/*.po" ,
443
+ allFiles
444
+ )
445
+ );
446
+ }
447
+
364
448
@ ParameterizedTest
365
449
@ MethodSource
366
450
public void testContainsParameter (String sourcePattern , boolean expected ) {
0 commit comments