def test_difference_endpoints_overlap_interior_preserved(self): left = RangeIndex(-8, 20, 7) right = RangeIndex(13, -9, -3) result = left.difference(right) expected = RangeIndex(-1, 13, 7) assert expected.tolist() == [-1, 6] tm.assert_index_equal(result, expected, exact=True)
def test_difference_interior_overlap_endpoints_preserved(self): left = RangeIndex(range(4)) right = RangeIndex(range(1, 3)) result = left.difference(right) expected = RangeIndex(0, 4, 3) assert expected.tolist() == [0, 3] tm.assert_index_equal(result, expected, exact=True)