File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public void ComparingTwoNullBlobsReturnsAnEmptyContentChanges()
128128 }
129129
130130 [ Fact ]
131- public void ComparingBlobsWithIndentHeuristicOptionMakesADifference ( )
131+ public void ComparingBlobsWithNoSpacesAndIndentHeuristicOptionMakesADifference ( )
132132 {
133133 var path = SandboxStandardTestRepoGitDir ( ) ;
134134 using ( var repo = new Repository ( path ) )
@@ -165,5 +165,40 @@ public void ComparingBlobsWithIndentHeuristicOptionMakesADifference()
165165 Assert . NotEqual ( changes0 . Patch , changes1 . Patch ) ;
166166 }
167167 }
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+ }
168203 }
169204}
You can’t perform that action at this time.
0 commit comments