Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Sep 28, 2024
1 parent 3a6c86e commit 23c64f1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,25 @@ def test_split_cells_mixed() -> None:
for position in range(1, test.cell_length):
left, right = Segment.split_cells(test, position)
assert cell_len(left.text) == position
assert cell_len(right.text) == test.cell_length - position


def test_split_cells_doubles() -> None:
"""Check that split cells splits on cell positions with all double width characters."""
test = Segment("早" * 20)
for position in range(1, test.cell_length):
left, right = Segment.split_cells(test, position)
assert cell_len(left.text) == position
assert cell_len(right.text) == test.cell_length - position


def test_split_cells_single() -> None:
"""Check that split cells splits on cell positions with all single width characters."""
test = Segment("A" * 20)
for position in range(1, test.cell_length):
left, right = Segment.split_cells(test, position)
assert cell_len(left.text) == position
assert cell_len(right.text) == test.cell_length - position


def test_segment_lines_renderable():
Expand Down

0 comments on commit 23c64f1

Please sign in to comment.