File tree 1 file changed +36
-1
lines changed
1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public void ComparingTwoNullBlobsReturnsAnEmptyContentChanges()
128
128
}
129
129
130
130
[ Fact ]
131
- public void ComparingBlobsWithIndentHeuristicOptionMakesADifference ( )
131
+ public void ComparingBlobsWithNoSpacesAndIndentHeuristicOptionMakesADifference ( )
132
132
{
133
133
var path = SandboxStandardTestRepoGitDir ( ) ;
134
134
using ( var repo = new Repository ( path ) )
@@ -165,5 +165,40 @@ public void ComparingBlobsWithIndentHeuristicOptionMakesADifference()
165
165
Assert . NotEqual ( changes0 . Patch , changes1 . Patch ) ;
166
166
}
167
167
}
168
+
169
+
170
+ [ Fact ]
171
+ public void ComparingBlobsWithNoSpacesIndentHeuristicOptionMakesNoDifference ( )
172
+ {
173
+ var path = SandboxStandardTestRepoGitDir ( ) ;
174
+ using ( var repo = new Repository ( path ) )
175
+ {
176
+ var oldContent =
177
+ @" 1
178
+ 2
179
+ a
180
+ b
181
+ 3
182
+ 4" ;
183
+ var newContent =
184
+ @" 1
185
+ 2
186
+ a
187
+ b
188
+ a
189
+ b
190
+ 3
191
+ 4" ;
192
+ var oldBlob = repo . ObjectDatabase . CreateBlob ( new MemoryStream ( Encoding . UTF8 . GetBytes ( oldContent ) ) ) ;
193
+ var newBlob = repo . ObjectDatabase . CreateBlob ( new MemoryStream ( Encoding . UTF8 . GetBytes ( newContent ) ) ) ;
194
+ var noIndentHeuristicOption = new CompareOptions { IndentHeuristic = false } ;
195
+ var indentHeuristicOption = new CompareOptions { IndentHeuristic = true } ;
196
+
197
+ ContentChanges changes0 = repo . Diff . Compare ( oldBlob , newBlob , noIndentHeuristicOption ) ;
198
+ ContentChanges changes1 = repo . Diff . Compare ( oldBlob , newBlob , indentHeuristicOption ) ;
199
+
200
+ Assert . Equal ( changes0 . Patch , changes1 . Patch ) ;
201
+ }
202
+ }
168
203
}
169
204
}
You can’t perform that action at this time.
0 commit comments