@@ -77,4 +77,25 @@ public async Task Test_IgnoreFile_Process_Without_GitIgnore(string searchDir, st
77
77
78
78
Assert . Equal ( expectations , fileNames ) ;
79
79
}
80
+
81
+ [ Theory ]
82
+ [ InlineData ( "a" ,
83
+ new [ ] { "a/a.txt" , "a/b/d/d.txt" , "a/b/d/h.txt" , "a/b/e/e.txt" , "a/c/c.txt" , "a/c/g/g.txt" } ) ]
84
+ [ InlineData ( "a/b" , new [ ] { "a/b/b.txt" , "a/b/d/d.txt" , "a/b/d/h.txt" , "a/b/e/e.txt" } ) ]
85
+ [ InlineData ( "a/b/d" , new [ ] { "a/b/d/d.txt" , "a/b/d/h.txt" } ) ]
86
+ [ InlineData ( "a/b/e" , new [ ] { "a/b/e/e.txt" } ) ]
87
+ [ InlineData ( "a/c" , new [ ] { "a/c/c.txt" , "a/c/g/g.txt" } ) ]
88
+ [ InlineData ( "a/c/g" , new [ ] { "a/c/g/g.txt" } ) ]
89
+ public async Task Test_IgnoreFile_Process_Without_Git ( string searchDir , string [ ] expectedFiles )
90
+ {
91
+ var executingDir = new DirectoryInfo ( Path . Combine ( Directory . GetCurrentDirectory ( ) , searchDir ) ) ;
92
+ var fileCollector = new FileCollector ( new Output ( new CliOptions ( ) ) ) ;
93
+ var files = ( await fileCollector . CollectAsync ( executingDir , null , CancellationToken . None ) ) . ToArray ( ) ;
94
+
95
+ var expectations = expectedFiles . Select ( f => Path . Combine ( Directory . GetCurrentDirectory ( ) , f ) . WithSlashes ( ) ) . Order ( )
96
+ . ToArray ( ) ;
97
+ var fileNames = files . Select ( f => f . FullName . WithSlashes ( ) ) . Order ( ) ;
98
+
99
+ Assert . Equal ( expectations , fileNames ) ;
100
+ }
80
101
}
0 commit comments