def test_decrement_right(self): ranges = [(1, 5)] remove_from_ranges(ranges, 5) self.assertEqual(ranges, [(1, 4)])
def test_dont_removing_unmatched_range(self): ranges = [(1, 3), (5, 7)] remove_from_ranges(ranges, 4) self.assertEqual(ranges, [(1, 3), (5, 7)])
def test_split_range_into_ranges(self): ranges = [(1, 7)] remove_from_ranges(ranges, 4) self.assertEqual(ranges, [(1, 3), (5, 7)])
def test_decrement_left(self): ranges = [(1, 5)] remove_from_ranges(ranges, 1) self.assertEqual(ranges, [(2, 5)])
def test_remove_unexistent(self): ranges = [1, 3] remove_from_ranges(ranges, 2) self.assertEqual(ranges, [1, 3])
def test_split_range(self): ranges = [(1, 5)] remove_from_ranges(ranges, 3) self.assertEqual(ranges, [1, 2, 4, 5])
def test_remove_inside(self): ranges = [1, 2, 3] remove_from_ranges(ranges, 2) self.assertEqual(ranges, [1, 3])
def test_remove_after(self): ranges = [1, 2] remove_from_ranges(ranges, 2) self.assertEqual(ranges, [1])
def test_remove_before(self): ranges = [1, 2] remove_from_ranges(ranges, 1) self.assertEqual(ranges, [2])
def test_single(self): ranges = [1] remove_from_ranges(ranges, 1) self.assertEqual(ranges, [])
def test_empty(self): ranges = [] remove_from_ranges(ranges, 1) self.assertEqual(ranges, [])