def test_subset(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [6, 8]) self.assertSequenceEqual([[5, 10], [15, 20], [25, 30]], r)
def test_add_upper_overlap(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [17, 21]) self.assertSequenceEqual([[5, 10], [15, 21], [25, 30]], r)
def test_add_min_overlap(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [1, 5]) self.assertSequenceEqual([[1, 10], [15, 20], [25, 30]], r)
def test_add_new_max(self): r = [[4, 8], [10, 15]] add_range(r, [18, 30]) self.assertSequenceEqual([[4, 8], [10, 15], [18, 30]], r)
def test_add_lower_overlap(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [12, 16]) self.assertSequenceEqual([[5, 10], [12, 20], [25, 30]], r)
def test_add_to_empty(self): r = [] add_range(r, [3, 7]) self.assertSequenceEqual([[3, 7]], r)
def test_add_new_min(self): r = [[4, 8], [10, 15]] add_range(r, [1, 3]) self.assertSequenceEqual([[1, 3], [4, 8], [10, 15]], r)
def test_subset_singleton(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [17, 17]) self.assertSequenceEqual([[5, 10], [15, 20], [25, 30]], r)
def test_add_to_nonempty(self): r = [[1, 2]] add_range(r, [5, 6]) self.assertSequenceEqual([[1, 2], [5, 6]], r)
def test_equal_singleton(self): r = [[5, 10], [15, 15], [25, 30]] add_range(r, [15, 15]) self.assertSequenceEqual([[5, 10], [15, 15], [25, 30]], r)
def test_merge_all_superset(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [4, 31]) self.assertSequenceEqual([[4, 31]], r)
def test_merge_all_in_both(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [6, 25]) self.assertSequenceEqual([[5, 30]], r)
def test_merge_in_upper(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [13, 25]) self.assertSequenceEqual([[5, 10], [13, 30]], r)
def test_merge_in_lower(self): r = [[5, 10], [15, 20], [25, 30]] add_range(r, [16, 31]) self.assertSequenceEqual([[5, 10], [15, 31]], r)