def test_ThreeIntervalsOverlapTwoEqualsEndStart_MergeOverlapDontMergeEquals( self): intervals = [[6, 9], [8, 12], [11, 14], [14, 16]] result = merge_overlap_intervals(intervals) expected = [[6, 14], [14, 16]] self.assertEqual(result, expected)
def test_NoOverlappingIntervals_NoChange(self): intervals = [ [2, 4], [6, 9], [11, 12], ] result = merge_overlap_intervals(intervals) expected = [ [2, 4], [6, 9], [11, 12], ] self.assertEqual(result, expected)
def test_ThreeIntervalsOverlap_Merge(self): intervals = [[6, 9], [8, 12], [11, 14]] result = merge_overlap_intervals(intervals) expected = [[6, 14]] self.assertEqual(result, expected)
def test_TwoIntervalsEqualEndStart_NoChange(self): intervals = [[6, 9], [9, 12]] result = merge_overlap_intervals(intervals) expected = [[6, 9], [9, 12]] self.assertEqual(result, expected)