Check that split cells splits on cell positions.
(segment: Segment)
| 314 | ], |
| 315 | ) |
| 316 | def test_split_cells_mixed(segment: Segment) -> None: |
| 317 | """Check that split cells splits on cell positions.""" |
| 318 | # Caused https://github.com/Textualize/textual/issues/4996 in Textual |
| 319 | |
| 320 | for position in range(0, segment.cell_length + 1): |
| 321 | left, right = Segment.split_cells(segment, position) |
| 322 | assert all( |
| 323 | cell_len(c) > 0 for c in segment.text |
| 324 | ) # Sanity check there aren't any sneaky control codes |
| 325 | assert cell_len(left.text) == position |
| 326 | assert cell_len(right.text) == segment.cell_length - position |
| 327 | |
| 328 | |
| 329 | def test_split_cells_doubles() -> None: |
nothing calls this directly
no test coverage detected