@@ -307,9 +307,6 @@ public void TestSortedEnumerable2()
307307 Assert . Equal ( tree , [ 0 , 1 ] ) ;
308308 }
309309
310- public static bool SpansOverlapsWith ( ( int start , int length ) left , ( int start , int length ) right )
311- => Math . Max ( left . start , right . start ) < Math . Min ( left . start + left . length , right . start + right . length ) ;
312-
313310 private void TestOverlapsAndIntersects ( IList < Tuple < int , int , string > > spans )
314311 {
315312 foreach ( var tree in CreateTrees ( spans ) )
@@ -319,19 +316,19 @@ private void TestOverlapsAndIntersects(IList<Tuple<int, int, string>> spans)
319316 {
320317 for ( var length = 1 ; length <= max ; length ++ )
321318 {
322- var span = ( start , length ) ;
319+ var span = new TextSpan ( start , length ) ;
323320
324321 var set1 = new HashSet < string > ( GetIntervalsThatOverlapWith ( tree , start , length ) . Select ( i => i . Item3 ) ) ;
325322 var set2 = new HashSet < string > ( spans . Where ( t =>
326323 {
327- return SpansOverlapsWith ( span , ( t . Item1 , t . Item2 ) ) ;
324+ return span . OverlapsWith ( new TextSpan ( t . Item1 , t . Item2 ) ) ;
328325 } ) . Select ( t => t . Item3 ) ) ;
329326 Assert . True ( set1 . SetEquals ( set2 ) ) ;
330327
331328 var set3 = new HashSet < string > ( GetIntervalsThatIntersectWith ( tree , start , length ) . Select ( i => i . Item3 ) ) ;
332329 var set4 = new HashSet < string > ( spans . Where ( t =>
333330 {
334- return SpansOverlapsWith ( span , ( t . Item1 , t . Item2 ) ) ;
331+ return span . IntersectsWith ( new TextSpan ( t . Item1 , t . Item2 ) ) ;
335332 } ) . Select ( t => t . Item3 ) ) ;
336333 Assert . True ( set3 . SetEquals ( set4 ) ) ;
337334 }
0 commit comments