@@ -305,7 +305,7 @@ func constructSingleDimensionQueryTestTree() (
305305
306306 it := newTree (1 )
307307
308- iv1 := constructSingleDimensionInterval (5 , 10 , 0 )
308+ iv1 := constructSingleDimensionInterval (6 , 10 , 0 )
309309 it .Add (iv1 )
310310
311311 iv2 := constructSingleDimensionInterval (4 , 5 , 1 )
@@ -329,7 +329,7 @@ func TestSimpleQuery(t *testing.T) {
329329func TestRightQuery (t * testing.T ) {
330330 it , iv1 , _ , iv3 := constructSingleDimensionQueryTestTree ()
331331
332- result := it .Query (constructSingleDimensionInterval (5 , 8 , 0 ))
332+ result := it .Query (constructSingleDimensionInterval (6 , 8 , 0 ))
333333
334334 expected := Intervals {iv1 , iv3 }
335335 assert .Equal (t , expected , result )
@@ -356,7 +356,7 @@ func TestMatchingQuery(t *testing.T) {
356356func TestNoMatchLeft (t * testing.T ) {
357357 it , _ , _ , _ := constructSingleDimensionQueryTestTree ()
358358
359- result := it .Query (constructSingleDimensionInterval (1 , 4 , 0 ))
359+ result := it .Query (constructSingleDimensionInterval (1 , 3 , 0 ))
360360
361361 expected := Intervals {}
362362 assert .Equal (t , expected , result )
@@ -365,7 +365,7 @@ func TestNoMatchLeft(t *testing.T) {
365365func TestNoMatchRight (t * testing.T ) {
366366 it , _ , _ , _ := constructSingleDimensionQueryTestTree ()
367367
368- result := it .Query (constructSingleDimensionInterval (12 , 13 , 0 ))
368+ result := it .Query (constructSingleDimensionInterval (13 , 13 , 0 ))
369369
370370 expected := Intervals {}
371371 assert .Equal (t , expected , result )
@@ -601,11 +601,11 @@ func TestAddDeleteDuplicatesRebalanceRandomOrder(t *testing.T) {
601601func TestInsertSingleAtDimension (t * testing.T ) {
602602 tree , ivs := constructSingleDimensionTestTree (3 )
603603
604- modified , deleted := tree .Insert (1 , 10 , 1 )
604+ modified , deleted := tree .Insert (1 , 11 , 1 )
605605 assert .Len (t , deleted , 0 )
606606 assert .Equal (t , ivs [1 :], modified )
607607
608- result := tree .Query (constructSingleDimensionInterval (10 , 20 , 0 ))
608+ result := tree .Query (constructSingleDimensionInterval (11 , 20 , 0 ))
609609 assert .Equal (t , ivs [1 :], result )
610610 checkRedBlack (t , tree .root , 1 )
611611
@@ -616,7 +616,7 @@ func TestInsertSingleAtDimension(t *testing.T) {
616616func TestInsertMultipleAtDimension (t * testing.T ) {
617617 tree , ivs := constructSingleDimensionTestTree (3 )
618618
619- modified , deleted := tree .Insert (1 , 10 , 2 )
619+ modified , deleted := tree .Insert (1 , 11 , 2 )
620620 assert .Len (t , deleted , 0 )
621621 assert .Equal (t , ivs [1 :], modified )
622622
@@ -635,7 +635,7 @@ func TestInsertAtLowestIndex(t *testing.T) {
635635 assert .Equal (t , ivs [0 :], modified )
636636 assert .Len (t , deleted , 0 )
637637
638- result := tree .Query (constructSingleDimensionInterval (0 , 1 , 0 ))
638+ result := tree .Query (constructSingleDimensionInterval (0 , 0 , 0 ))
639639 assert .Len (t , result , 0 )
640640
641641 result = tree .Query (constructSingleDimensionInterval (1 , 4 , 0 ))
@@ -650,12 +650,12 @@ func TestInsertAtLowestIndex(t *testing.T) {
650650func TestDeleteSingleAtDimension (t * testing.T ) {
651651 tree , ivs := constructSingleDimensionTestTree (3 )
652652
653- modified , deleted := tree .Insert (1 , 10 , - 1 )
653+ modified , deleted := tree .Insert (1 , 11 , - 1 )
654654 assert .Equal (t , ivs [1 :], modified )
655655 assert .Len (t , deleted , 0 )
656656
657- result := tree .Query (constructSingleDimensionInterval (10 , 20 , 0 ))
658- assert .Equal (t , ivs [2 :], result )
657+ result := tree .Query (constructSingleDimensionInterval (11 , 20 , 0 ))
658+ assert .Equal (t , ivs [1 :], result )
659659
660660 result = tree .Query (constructSingleDimensionInterval (9 , 20 , 0 ))
661661 assert .Equal (t , ivs , result )
@@ -681,7 +681,7 @@ func TestDeleteBelowLowestIndex(t *testing.T) {
681681 assert .Equal (t , ivs , modified )
682682 assert .Len (t , deleted , 0 )
683683
684- result := tree .Query (constructSingleDimensionInterval (0 , 1 , 0 ))
684+ result := tree .Query (constructSingleDimensionInterval (0 , 0 , 0 ))
685685 assert .Equal (t , ivs [:1 ], result )
686686
687687 result = tree .Query (constructSingleDimensionInterval (0 , 10 , 0 ))
@@ -695,11 +695,11 @@ func TestDeleteBelowLowestIndex(t *testing.T) {
695695func TestInsertDeletesInterval (t * testing.T ) {
696696 tree , ivs := constructSingleDimensionTestTree (3 )
697697
698- modified , deleted := tree .Insert (1 , 0 , - 10 )
698+ modified , deleted := tree .Insert (1 , 0 , - 11 )
699699 assert .Equal (t , ivs [1 :], modified )
700700 assert .Equal (t , ivs [:1 ], deleted )
701701
702- result := tree .Query (constructSingleDimensionInterval (2 , 10 , 0 ))
702+ result := tree .Query (constructSingleDimensionInterval (3 , 10 , 0 ))
703703 assert .Len (t , result , 0 )
704704
705705 result = tree .Query (constructSingleDimensionInterval (0 , 2 , 0 ))
@@ -708,7 +708,7 @@ func TestInsertDeletesInterval(t *testing.T) {
708708 checkRedBlack (t , tree .root , 1 )
709709 assert .Equal (t , uint64 (2 ), tree .Len ())
710710 assert .Equal (t , int64 (0 ), tree .root .min )
711- assert .Equal (t , int64 (2 ), tree .root .max )
711+ assert .Equal (t , int64 (1 ), tree .root .max )
712712}
713713
714714func TestDeleteMiddleOfRange (t * testing.T ) {
0 commit comments