MCPcopy
hub / github.com/Textualize/rich / test_split_cells_mixed

Function test_split_cells_mixed

tests/test_segment.py:316–326  ·  view source on GitHub ↗

Check that split cells splits on cell positions.

(segment: Segment)

Source from the content-addressed store, hash-verified

314 ],
315)
316def 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
329def test_split_cells_doubles() -> None:

Callers

nothing calls this directly

Calls 2

cell_lenFunction · 0.90
split_cellsMethod · 0.80

Tested by

no test coverage detected