@@ -372,12 +372,11 @@ public void StemCorrectWithDifferentWildCards()
372
372
public void StemCorrectWithDifferentWildCards_WithInMemory ( )
373
373
{
374
374
var matcher = new Matcher ( ) ;
375
- matcher . AddInclude ( "sub/*.cs" ) ;
376
- matcher . AddInclude ( "**/*.cs" ) ;
375
+ matcher . AddInclude ( "src/project/ sub/*.cs" ) ;
376
+ matcher . AddInclude ( "src/project/ **/*.cs" ) ;
377
377
378
378
var files = GetFileList ( ) ;
379
- var directoryPath = "src/project" ;
380
- var results = matcher . Match ( directoryPath , files ) ;
379
+ var results = matcher . Match ( "./" , files ) ;
381
380
382
381
var actual = results . Files . Select ( match => match . Stem ) ;
383
382
var expected = new string [ ]
@@ -425,11 +424,10 @@ public void MultipleSubDirsAfterFirstWildcardMatch_HasCorrectStem()
425
424
public void MultipleSubDirsAfterFirstWildcardMatch_HasCorrectStem_WithInMemory ( )
426
425
{
427
426
var matcher = new Matcher ( ) ;
428
- matcher . AddInclude ( "compiler/**/*.cs" ) ;
427
+ matcher . AddInclude ( "src/project/ compiler/**/*.cs" ) ;
429
428
430
429
var files = GetFileList ( ) ;
431
- var directoryPath = "src/project" ;
432
- var results = matcher . Match ( directoryPath , files ) ;
430
+ var results = matcher . Match ( "./" , files ) ;
433
431
434
432
var actual = results . Files . Select ( match => match . Stem ) ;
435
433
var expected = new string [ ]
@@ -450,12 +448,10 @@ public void MultipleSubDirsAfterFirstWildcardMatch_HasCorrectStem_WithInMemory()
450
448
[ InlineData ( @"root" , @"**/*.0" , @"test.0" ) ]
451
449
public void PathIncludesAllSegmentsFromPattern_RootDirectory ( string root , string includePattern , string expectedPath )
452
450
{
453
- var fileToFind = @"root/test.0" ;
454
-
455
451
var matcher = new Matcher ( ) ;
456
452
matcher . AddInclude ( includePattern ) ;
457
453
458
- var results = matcher . Match ( root , new [ ] { fileToFind } ) ;
454
+ var results = matcher . Match ( root , new [ ] { expectedPath } ) ;
459
455
var actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
460
456
461
457
Assert . Equal ( expectedPath , actualPath ) ;
@@ -464,7 +460,7 @@ public void PathIncludesAllSegmentsFromPattern_RootDirectory(string root, string
464
460
matcher = new Matcher ( ) ;
465
461
matcher . AddInclude ( "./" + includePattern ) ;
466
462
467
- results = matcher . Match ( root , new [ ] { fileToFind } ) ;
463
+ results = matcher . Match ( root , new [ ] { expectedPath } ) ;
468
464
actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
469
465
470
466
Assert . Equal ( expectedPath , actualPath ) ;
@@ -480,12 +476,10 @@ public void PathIncludesAllSegmentsFromPattern_RootDirectory(string root, string
480
476
[ InlineData ( @"root" , @"**/*.1" , @"dir1/test.1" ) ]
481
477
public void PathIncludesAllSegmentsFromPattern_OneDirectoryDeep ( string root , string includePattern , string expectedPath )
482
478
{
483
- var fileToFind = @"root/dir1/test.1" ;
484
-
485
479
var matcher = new Matcher ( ) ;
486
480
matcher . AddInclude ( includePattern ) ;
487
481
488
- var results = matcher . Match ( root , new [ ] { fileToFind } ) ;
482
+ var results = matcher . Match ( root , new [ ] { expectedPath } ) ;
489
483
var actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
490
484
491
485
Assert . Equal ( expectedPath , actualPath ) ;
@@ -494,7 +488,7 @@ public void PathIncludesAllSegmentsFromPattern_OneDirectoryDeep(string root, str
494
488
matcher = new Matcher ( ) ;
495
489
matcher . AddInclude ( "./" + includePattern ) ;
496
490
497
- results = matcher . Match ( root , new [ ] { fileToFind } ) ;
491
+ results = matcher . Match ( root , new [ ] { expectedPath } ) ;
498
492
actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
499
493
500
494
Assert . Equal ( expectedPath , actualPath ) ;
@@ -520,12 +514,10 @@ public void PathIncludesAllSegmentsFromPattern_OneDirectoryDeep(string root, str
520
514
[ InlineData ( @"root" , @"**/*.2" , @"dir1/dir2/test.2" ) ]
521
515
public void PathIncludesAllSegmentsFromPattern_TwoDirectoriesDeep ( string root , string includePattern , string expectedPath )
522
516
{
523
- var fileToFind = @"root/dir1/dir2/test.2" ;
524
-
525
517
var matcher = new Matcher ( ) ;
526
518
matcher . AddInclude ( includePattern ) ;
527
519
528
- var results = matcher . Match ( root , new [ ] { fileToFind } ) ;
520
+ var results = matcher . Match ( root , new [ ] { expectedPath } ) ;
529
521
var actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
530
522
531
523
Assert . Equal ( expectedPath , actualPath ) ;
@@ -534,7 +526,7 @@ public void PathIncludesAllSegmentsFromPattern_TwoDirectoriesDeep(string root, s
534
526
matcher = new Matcher ( ) ;
535
527
matcher . AddInclude ( "./" + includePattern ) ;
536
528
537
- results = matcher . Match ( root , new [ ] { fileToFind } ) ;
529
+ results = matcher . Match ( root , new [ ] { expectedPath } ) ;
538
530
actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
539
531
540
532
Assert . Equal ( expectedPath , actualPath ) ;
@@ -545,7 +537,7 @@ public void PathIncludesAllSegmentsFromPattern_TwoDirectoriesDeep(string root, s
545
537
[ InlineData ( @"root" , @"**/*.0" , @"test.0" ) ]
546
538
public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_RootDirectory ( string root , string includePattern , string expectedStem )
547
539
{
548
- var fileToFind = @"root/ test.0";
540
+ string fileToFind = " test.0";
549
541
550
542
var matcher = new Matcher ( ) ;
551
543
matcher . AddInclude ( includePattern ) ;
@@ -565,18 +557,16 @@ public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_RootDirectory(s
565
557
Assert . Equal ( expectedStem , actualStem ) ;
566
558
}
567
559
568
- [ Theory ] // rootDir, includePattern, expectedStem
569
- [ InlineData ( @"root/dir1" , @"*.1" , @"test.1" ) ]
570
- [ InlineData ( @"root/dir1" , @"**/*.1" , @"test.1" ) ]
571
- [ InlineData ( @"root" , @"dir1/*.1" , @"test.1" ) ]
572
- [ InlineData ( @"root" , @"dir1/**/*.1" , @"test.1" ) ]
573
- [ InlineData ( @"root" , @"**/dir1/*.1" , @"dir1/test.1" ) ]
574
- [ InlineData ( @"root" , @"**/dir1/**/*.1" , @"dir1/test.1" ) ]
575
- [ InlineData ( @"root" , @"**/*.1" , @"dir1/test.1" ) ]
576
- public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_OneDirectoryDeep ( string root , string includePattern , string expectedStem )
560
+ [ Theory ] // rootDir, includePattern, fileToFind expectedStem
561
+ [ InlineData ( @"root/dir1" , @"*.1" , @"test.1" , @"test.1" ) ]
562
+ [ InlineData ( @"root/dir1" , @"**/*.1" , @"test.1" , @"test.1" ) ]
563
+ [ InlineData ( @"root" , @"dir1/*.1" , @"dir1/test.1" , @" test.1") ]
564
+ [ InlineData ( @"root" , @"dir1/**/*.1" , @"dir1/test.1" , @" test.1") ]
565
+ [ InlineData ( @"root" , @"**/dir1/*.1" , @"dir1/test.1" , @"dir1/test.1" ) ]
566
+ [ InlineData ( @"root" , @"**/dir1/**/*.1" , @"dir1/test.1" , @"dir1/test.1" ) ]
567
+ [ InlineData ( @"root" , @"**/*.1" , @"dir1/test.1" , @"dir1/test.1" ) ]
568
+ public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_OneDirectoryDeep ( string root , string includePattern , string fileToFind , string expectedStem )
577
569
{
578
- var fileToFind = @"root/dir1/test.1" ;
579
-
580
570
var matcher = new Matcher ( ) ;
581
571
matcher . AddInclude ( includePattern ) ;
582
572
@@ -595,28 +585,26 @@ public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_OneDirectoryDee
595
585
Assert . Equal ( expectedStem , actualStem ) ;
596
586
}
597
587
598
- [ Theory ] // rootDir, includePattern, expectedStem
599
- [ InlineData ( @"root/dir1/dir2" , @"*.2" , @"test.2" ) ]
600
- [ InlineData ( @"root/dir1/dir2" , @"**/*.2" , @"test.2" ) ]
601
- [ InlineData ( @"root/dir1" , @"dir2/*.2" , @"test.2" ) ]
602
- [ InlineData ( @"root/dir1" , @"dir2/**/*.2" , @"test.2" ) ]
603
- [ InlineData ( @"root/dir1" , @"**/dir2/*.2" , @"dir2/test.2" ) ]
604
- [ InlineData ( @"root/dir1" , @"**/dir2/**/*.2" , @"dir2/test.2" ) ]
605
- [ InlineData ( @"root/dir1" , @"**/*.2" , @"dir2/test.2" ) ]
606
- [ InlineData ( @"root" , @"dir1/dir2/*.2" , @"test.2" ) ]
607
- [ InlineData ( @"root" , @"dir1/dir2/**/*.2" , @"test.2" ) ]
608
- [ InlineData ( @"root" , @"**/dir1/dir2/**/*.2" , @"dir1/dir2/test.2" ) ]
609
- [ InlineData ( @"root" , @"**/dir1/**/dir2/*.2" , @"dir1/dir2/test.2" ) ]
610
- [ InlineData ( @"root" , @"**/dir1/**/dir2/**/*.2" , @"dir1/dir2/test.2" ) ]
611
- [ InlineData ( @"root" , @"dir1/**/*.2" , @"dir2/test.2" ) ]
612
- [ InlineData ( @"root" , @"**/dir1/**/*.2" , @"dir1/dir2/test.2" ) ]
613
- [ InlineData ( @"root" , @"**/dir2/*.2" , @"dir1/dir2/test.2" ) ]
614
- [ InlineData ( @"root" , @"**/dir2/**/*.2" , @"dir1/dir2/test.2" ) ]
615
- [ InlineData ( @"root" , @"**/*.2" , @"dir1/dir2/test.2" ) ]
616
- public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_TwoDirectoriesDeep ( string root , string includePattern , string expectedStem )
588
+ [ Theory ] // rootDir, includePattern, fileToFind expectedStem
589
+ [ InlineData ( @"root/dir1/dir2" , @"*.2" , @"test.2" , @"test.2" ) ]
590
+ [ InlineData ( @"root/dir1/dir2" , @"**/*.2" , @"test.2" , @"test.2" ) ]
591
+ [ InlineData ( @"root/dir1" , @"dir2/*.2" , @"dir2/test.2" , @" test.2") ]
592
+ [ InlineData ( @"root/dir1" , @"dir2/**/*.2" , @"dir2/test.2" , @" test.2") ]
593
+ [ InlineData ( @"root/dir1" , @"**/dir2/*.2" , @"dir2/test.2" , @"dir2/test.2" ) ]
594
+ [ InlineData ( @"root/dir1" , @"**/dir2/**/*.2" , @"dir2/test.2" , @"dir2/test.2" ) ]
595
+ [ InlineData ( @"root/dir1" , @"**/*.2" , @"dir2/test.2" , @"dir2/test.2" ) ]
596
+ [ InlineData ( @"root" , @"dir1/dir2/*.2" , @"dir1/dir2/test.2" , @" test.2") ]
597
+ [ InlineData ( @"root" , @"dir1/dir2/**/*.2" , @"dir1/dir2/test.2" , @" test.2") ]
598
+ [ InlineData ( @"root" , @"**/dir1/dir2/**/*.2" , @"dir1/dir2/test.2" , @"dir1/dir2/test.2" ) ]
599
+ [ InlineData ( @"root" , @"**/dir1/**/dir2/*.2" , @"dir1/dir2/test.2" , @"dir1/dir2/test.2" ) ]
600
+ [ InlineData ( @"root" , @"**/dir1/**/dir2/**/*.2" , @"dir1/dir2/test.2" , @"dir1/dir2/test.2" ) ]
601
+ [ InlineData ( @"root" , @"dir1/**/*.2" , @"dir1/dir2/test.2" , @" dir2/test.2") ]
602
+ [ InlineData ( @"root" , @"**/dir1/**/*.2" , @"dir1/dir2/test.2" , @"dir1/dir2/test.2" ) ]
603
+ [ InlineData ( @"root" , @"**/dir2/*.2" , @"dir1/dir2/test.2" , @"dir1/dir2/test.2" ) ]
604
+ [ InlineData ( @"root" , @"**/dir2/**/*.2" , @"dir1/dir2/test.2" , @"dir1/dir2/test.2" ) ]
605
+ [ InlineData ( @"root" , @"**/*.2" , @"dir1/dir2/test.2" , @"dir1/dir2/test.2" ) ]
606
+ public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_TwoDirectoriesDeep ( string root , string includePattern , string fileToFind , string expectedStem )
617
607
{
618
- var fileToFind = @"root/dir1/dir2/test.2" ;
619
-
620
608
var matcher = new Matcher ( ) ;
621
609
matcher . AddInclude ( includePattern ) ;
622
610
@@ -844,7 +832,6 @@ public void VerifyAbsolutePaths_HasMatches()
844
832
}
845
833
846
834
[ Fact ] // https://github.com/dotnet/runtime/issues/36415
847
- [ ActiveIssue ( "https://github.com/dotnet/runtime/issues/50648" ) ]
848
835
public void VerifyInMemoryDirectoryInfo_IsNotEmpty ( )
849
836
{
850
837
IEnumerable < string > files = new [ ] { @"pagefile.sys" } ;
0 commit comments