@@ -245,6 +245,64 @@ public void ShouldParseCleanWorkingTreeTracked()
245245 } ) ;
246246 }
247247
248+ [ Test ]
249+ public void ShouldSortOutputCorrectly ( )
250+ {
251+ var output = new [ ]
252+ {
253+ "## master" ,
254+ "?? GitHub.Unity.dll" ,
255+ "?? GitHub.Unity.dll.mdb" ,
256+ "?? GitHub.Unity.dll.mdb.meta" ,
257+ "?? GitHub.Unity.dll.meta" ,
258+ null
259+ } ;
260+
261+ AssertProcessOutput ( output , new GitStatus
262+ {
263+ LocalBranch = "master" ,
264+ Entries = new List < GitStatusEntry >
265+ {
266+ new GitStatusEntry ( @"GitHub.Unity.dll" , TestRootPath + @"\GitHub.Unity.dll" , null , GitFileStatus . Untracked ) ,
267+ new GitStatusEntry ( @"GitHub.Unity.dll.meta" , TestRootPath + @"\GitHub.Unity.dll.meta" , null , GitFileStatus . Untracked ) ,
268+ new GitStatusEntry ( @"GitHub.Unity.dll.mdb" , TestRootPath + @"\GitHub.Unity.dll.mdb" , null , GitFileStatus . Untracked ) ,
269+ new GitStatusEntry ( @"GitHub.Unity.dll.mdb.meta" , TestRootPath + @"\GitHub.Unity.dll.mdb.meta" , null , GitFileStatus . Untracked ) ,
270+ }
271+ } ) ;
272+ }
273+
274+ [ Test ]
275+ public void ShouldSortOutputCorrectly2 ( )
276+ {
277+ var output = new [ ]
278+ {
279+ "## master" ,
280+ "?? Assets/Assets.Test.dll" ,
281+ "?? Assets/Assets.Test.dll.meta" ,
282+ "?? Plugins/GitHub.Unity.dll" ,
283+ "?? Plugins/GitHub.Unity.dll.mdb" ,
284+ "?? Plugins/GitHub.Unity.dll.mdb.meta" ,
285+ "?? Plugins/GitHub.Unity.dll.meta" ,
286+ "?? blah.txt" ,
287+ null
288+ } ;
289+
290+ AssertProcessOutput ( output , new GitStatus
291+ {
292+ LocalBranch = "master" ,
293+ Entries = new List < GitStatusEntry >
294+ {
295+ new GitStatusEntry ( @"Assets/Assets.Test.dll" , TestRootPath + @"\Assets/Assets.Test.dll" , null , GitFileStatus . Untracked ) ,
296+ new GitStatusEntry ( @"Assets/Assets.Test.dll.meta" , TestRootPath + @"\Assets/Assets.Test.dll.meta" , null , GitFileStatus . Untracked ) ,
297+ new GitStatusEntry ( @"blah.txt" , TestRootPath + @"\blah.txt" , null , GitFileStatus . Untracked ) ,
298+ new GitStatusEntry ( @"Plugins/GitHub.Unity.dll" , TestRootPath + @"\Plugins/GitHub.Unity.dll" , null , GitFileStatus . Untracked ) ,
299+ new GitStatusEntry ( @"Plugins/GitHub.Unity.dll.meta" , TestRootPath + @"\Plugins/GitHub.Unity.dll.meta" , null , GitFileStatus . Untracked ) ,
300+ new GitStatusEntry ( @"Plugins/GitHub.Unity.dll.mdb" , TestRootPath + @"\Plugins/GitHub.Unity.dll.mdb" , null , GitFileStatus . Untracked ) ,
301+ new GitStatusEntry ( @"Plugins/GitHub.Unity.dll.mdb.meta" , TestRootPath + @"\Plugins/GitHub.Unity.dll.mdb.meta" , null , GitFileStatus . Untracked ) ,
302+ }
303+ } ) ;
304+ }
305+
248306 private void AssertProcessOutput ( IEnumerable < string > lines , GitStatus expected )
249307 {
250308 var gitObjectFactory = SubstituteFactory . CreateGitObjectFactory ( TestRootPath ) ;
@@ -262,4 +320,4 @@ private void AssertProcessOutput(IEnumerable<string> lines, GitStatus expected)
262320 result . Value . AssertEqual ( expected ) ;
263321 }
264322 }
265- }
323+ }
0 commit comments