File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11using System . IO ;
2+ using System . Linq ;
23using System . Text ;
34using LibGit2Sharp . Tests . TestHelpers ;
45using Xunit ;
@@ -163,10 +164,10 @@ public void ComparingBlobsWithNoSpacesAndIndentHeuristicOptionMakesADifference()
163164 ContentChanges changes1 = repo . Diff . Compare ( oldBlob , newBlob , indentHeuristicOption ) ;
164165
165166 Assert . NotEqual ( changes0 . Patch , changes1 . Patch ) ;
167+ Assert . Equal ( CanonicalChangedLines ( changes0 ) , CanonicalChangedLines ( changes1 ) ) ;
166168 }
167169 }
168170
169-
170171 [ Fact ]
171172 public void ComparingBlobsWithNoSpacesIndentHeuristicOptionMakesNoDifference ( )
172173 {
@@ -200,5 +201,11 @@ public void ComparingBlobsWithNoSpacesIndentHeuristicOptionMakesNoDifference()
200201 Assert . Equal ( changes0 . Patch , changes1 . Patch ) ;
201202 }
202203 }
204+
205+ static string CanonicalChangedLines ( ContentChanges changes )
206+ {
207+ // Create an ordered representation of lines that have been added or removed
208+ return string . Join ( "\n " , changes . Patch . Split ( '\n ' ) . Where ( l => l . StartsWith ( "+" ) || l . StartsWith ( "-" ) ) . OrderBy ( l => l ) ) ;
209+ }
203210 }
204211}
You can’t perform that action at this time.
0 commit comments