@@ -372,12 +372,11 @@ public void StemCorrectWithDifferentWildCards()
372372 public void StemCorrectWithDifferentWildCards_WithInMemory ( )
373373 {
374374 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" ) ;
377377
378378 var files = GetFileList ( ) ;
379- var directoryPath = "src/project" ;
380- var results = matcher . Match ( directoryPath , files ) ;
379+ var results = matcher . Match ( "./" , files ) ;
381380
382381 var actual = results . Files . Select ( match => match . Stem ) ;
383382 var expected = new string [ ]
@@ -425,11 +424,10 @@ public void MultipleSubDirsAfterFirstWildcardMatch_HasCorrectStem()
425424 public void MultipleSubDirsAfterFirstWildcardMatch_HasCorrectStem_WithInMemory ( )
426425 {
427426 var matcher = new Matcher ( ) ;
428- matcher . AddInclude ( "compiler/**/*.cs" ) ;
427+ matcher . AddInclude ( "src/project/ compiler/**/*.cs" ) ;
429428
430429 var files = GetFileList ( ) ;
431- var directoryPath = "src/project" ;
432- var results = matcher . Match ( directoryPath , files ) ;
430+ var results = matcher . Match ( "./" , files ) ;
433431
434432 var actual = results . Files . Select ( match => match . Stem ) ;
435433 var expected = new string [ ]
@@ -450,12 +448,10 @@ public void MultipleSubDirsAfterFirstWildcardMatch_HasCorrectStem_WithInMemory()
450448 [ InlineData ( @"root" , @"**/*.0" , @"test.0" ) ]
451449 public void PathIncludesAllSegmentsFromPattern_RootDirectory ( string root , string includePattern , string expectedPath )
452450 {
453- var fileToFind = @"root/test.0" ;
454-
455451 var matcher = new Matcher ( ) ;
456452 matcher . AddInclude ( includePattern ) ;
457453
458- var results = matcher . Match ( root , new [ ] { fileToFind } ) ;
454+ var results = matcher . Match ( root , new [ ] { expectedPath } ) ;
459455 var actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
460456
461457 Assert . Equal ( expectedPath , actualPath ) ;
@@ -464,7 +460,7 @@ public void PathIncludesAllSegmentsFromPattern_RootDirectory(string root, string
464460 matcher = new Matcher ( ) ;
465461 matcher . AddInclude ( "./" + includePattern ) ;
466462
467- results = matcher . Match ( root , new [ ] { fileToFind } ) ;
463+ results = matcher . Match ( root , new [ ] { expectedPath } ) ;
468464 actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
469465
470466 Assert . Equal ( expectedPath , actualPath ) ;
@@ -480,12 +476,10 @@ public void PathIncludesAllSegmentsFromPattern_RootDirectory(string root, string
480476 [ InlineData ( @"root" , @"**/*.1" , @"dir1/test.1" ) ]
481477 public void PathIncludesAllSegmentsFromPattern_OneDirectoryDeep ( string root , string includePattern , string expectedPath )
482478 {
483- var fileToFind = @"root/dir1/test.1" ;
484-
485479 var matcher = new Matcher ( ) ;
486480 matcher . AddInclude ( includePattern ) ;
487481
488- var results = matcher . Match ( root , new [ ] { fileToFind } ) ;
482+ var results = matcher . Match ( root , new [ ] { expectedPath } ) ;
489483 var actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
490484
491485 Assert . Equal ( expectedPath , actualPath ) ;
@@ -494,7 +488,7 @@ public void PathIncludesAllSegmentsFromPattern_OneDirectoryDeep(string root, str
494488 matcher = new Matcher ( ) ;
495489 matcher . AddInclude ( "./" + includePattern ) ;
496490
497- results = matcher . Match ( root , new [ ] { fileToFind } ) ;
491+ results = matcher . Match ( root , new [ ] { expectedPath } ) ;
498492 actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
499493
500494 Assert . Equal ( expectedPath , actualPath ) ;
@@ -520,12 +514,10 @@ public void PathIncludesAllSegmentsFromPattern_OneDirectoryDeep(string root, str
520514 [ InlineData ( @"root" , @"**/*.2" , @"dir1/dir2/test.2" ) ]
521515 public void PathIncludesAllSegmentsFromPattern_TwoDirectoriesDeep ( string root , string includePattern , string expectedPath )
522516 {
523- var fileToFind = @"root/dir1/dir2/test.2" ;
524-
525517 var matcher = new Matcher ( ) ;
526518 matcher . AddInclude ( includePattern ) ;
527519
528- var results = matcher . Match ( root , new [ ] { fileToFind } ) ;
520+ var results = matcher . Match ( root , new [ ] { expectedPath } ) ;
529521 var actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
530522
531523 Assert . Equal ( expectedPath , actualPath ) ;
@@ -534,7 +526,7 @@ public void PathIncludesAllSegmentsFromPattern_TwoDirectoriesDeep(string root, s
534526 matcher = new Matcher ( ) ;
535527 matcher . AddInclude ( "./" + includePattern ) ;
536528
537- results = matcher . Match ( root , new [ ] { fileToFind } ) ;
529+ results = matcher . Match ( root , new [ ] { expectedPath } ) ;
538530 actualPath = results . Files . Select ( file => file . Path ) . SingleOrDefault ( ) ;
539531
540532 Assert . Equal ( expectedPath , actualPath ) ;
@@ -545,7 +537,7 @@ public void PathIncludesAllSegmentsFromPattern_TwoDirectoriesDeep(string root, s
545537 [ InlineData ( @"root" , @"**/*.0" , @"test.0" ) ]
546538 public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_RootDirectory ( string root , string includePattern , string expectedStem )
547539 {
548- var fileToFind = @"root/ test.0";
540+ string fileToFind = " test.0";
549541
550542 var matcher = new Matcher ( ) ;
551543 matcher . AddInclude ( includePattern ) ;
@@ -565,18 +557,16 @@ public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_RootDirectory(s
565557 Assert . Equal ( expectedStem , actualStem ) ;
566558 }
567559
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 )
577569 {
578- var fileToFind = @"root/dir1/test.1" ;
579-
580570 var matcher = new Matcher ( ) ;
581571 matcher . AddInclude ( includePattern ) ;
582572
@@ -595,28 +585,26 @@ public void StemIncludesAllSegmentsFromPatternStartingAtWildcard_OneDirectoryDee
595585 Assert . Equal ( expectedStem , actualStem ) ;
596586 }
597587
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 )
617607 {
618- var fileToFind = @"root/dir1/dir2/test.2" ;
619-
620608 var matcher = new Matcher ( ) ;
621609 matcher . AddInclude ( includePattern ) ;
622610
@@ -844,7 +832,6 @@ public void VerifyAbsolutePaths_HasMatches()
844832 }
845833
846834 [ Fact ] // https://github.com/dotnet/runtime/issues/36415
847- [ ActiveIssue ( "https://github.com/dotnet/runtime/issues/50648" ) ]
848835 public void VerifyInMemoryDirectoryInfo_IsNotEmpty ( )
849836 {
850837 IEnumerable < string > files = new [ ] { @"pagefile.sys" } ;
0 commit comments