File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System . IO ;
2
+ using System . Linq ;
2
3
using System . Text ;
3
4
using LibGit2Sharp . Tests . TestHelpers ;
4
5
using Xunit ;
@@ -163,10 +164,10 @@ public void ComparingBlobsWithNoSpacesAndIndentHeuristicOptionMakesADifference()
163
164
ContentChanges changes1 = repo . Diff . Compare ( oldBlob , newBlob , indentHeuristicOption ) ;
164
165
165
166
Assert . NotEqual ( changes0 . Patch , changes1 . Patch ) ;
167
+ Assert . Equal ( CanonicalChangedLines ( changes0 ) , CanonicalChangedLines ( changes1 ) ) ;
166
168
}
167
169
}
168
170
169
-
170
171
[ Fact ]
171
172
public void ComparingBlobsWithNoSpacesIndentHeuristicOptionMakesNoDifference ( )
172
173
{
@@ -200,5 +201,11 @@ public void ComparingBlobsWithNoSpacesIndentHeuristicOptionMakesNoDifference()
200
201
Assert . Equal ( changes0 . Patch , changes1 . Patch ) ;
201
202
}
202
203
}
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
+ }
203
210
}
204
211
}
You can’t perform that action at this time.
0 commit comments