def test_split_cells_mixed(segment: Segment) -> None:
    """Check that split cells splits on cell positions."""
    # Caused https://github.com/Textualize/textual/issues/4996 in Textual

    for position in range(0, segment.cell_length + 1):
        left, right = Segment.split_cells(segment, position)
        assert all(
            cell_len(c) > 0 for c in segment.text
        )  # Sanity check there aren't any sneaky control codes
        assert cell_len(left.text) == position
        assert cell_len(right.text) == segment.cell_length - position
Check that split cells splits on cell positions.
tests/test_segment.py