@@ -907,18 +907,21 @@ func Test_diffBisect(t *testing.T) {
907
907
// Since the resulting diff hasn't been normalized, it would be ok if
908
908
// the insertion and deletion pairs are swapped.
909
909
// If the order changes, tweak this test as required.
910
- diffs := []Diff {
910
+ correctDiffs := []Diff {
911
911
Diff {DiffDelete , "c" },
912
912
Diff {DiffInsert , "m" },
913
913
Diff {DiffEqual , "a" },
914
914
Diff {DiffDelete , "t" },
915
915
Diff {DiffInsert , "p" }}
916
916
917
- assertDiffEqual (t , diffs , dmp .DiffBisect (a , b , time .Date (9999 , time .December , 31 , 23 , 59 , 59 , 59 , time .UTC )))
917
+ assertDiffEqual (t , correctDiffs , dmp .DiffBisect (a , b , time .Date (9999 , time .December , 31 , 23 , 59 , 59 , 59 , time .UTC )))
918
918
919
919
// Timeout.
920
- diffs = []Diff {Diff {DiffDelete , "cat" }, Diff {DiffInsert , "map" }}
921
- assertDiffEqual (t , diffs , dmp .DiffBisect (a , b , time .Date (0001 , time .January , 01 , 00 , 00 , 00 , 00 , time .UTC )))
920
+ diffs := []Diff {Diff {DiffDelete , "cat" }, Diff {DiffInsert , "map" }}
921
+ assertDiffEqual (t , diffs , dmp .DiffBisect (a , b , time .Now ().Add (time .Nanosecond )))
922
+
923
+ // Negative deadlines count as having infinite time.
924
+ assertDiffEqual (t , correctDiffs , dmp .DiffBisect (a , b , time .Date (0001 , time .January , 01 , 00 , 00 , 00 , 00 , time .UTC )))
922
925
}
923
926
924
927
func Test_diffMain (t * testing.T ) {
0 commit comments