| 678 | |
| 679 | |
| 680 | def test_slice_compatibility(): |
| 681 | arr = pa.array(["", "𝑓", "𝑓ö", "𝑓öõ", "𝑓öõḍ", "𝑓öõḍš"]) |
| 682 | for start in range(-6, 6): |
| 683 | for stop in itertools.chain(range(-6, 6), [None]): |
| 684 | for step in [-3, -2, -1, 1, 2, 3]: |
| 685 | expected = pa.array([k.as_py()[start:stop:step] |
| 686 | for k in arr]) |
| 687 | result = pc.utf8_slice_codeunits( |
| 688 | arr, start=start, stop=stop, step=step) |
| 689 | assert expected.equals(result) |
| 690 | # Positional options |
| 691 | assert pc.utf8_slice_codeunits(arr, |
| 692 | start, stop, step) == result |
| 693 | |
| 694 | |
| 695 | def test_binary_slice_compatibility(): |