Skip to content

Commit

Permalink
More multicell rewrap tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 29, 2024
1 parent 7ac21ce commit 2f45d13
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions kitty_tests/multicell.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,11 @@ def reset():
ac(0, y, is_multicell=False), ac(1, y, is_multicell=True), ac(3, y, is_multicell=True)
ac(0, 1, is_multicell=False, text='2'), ac(4, 1, is_multicell=False, text='3')

reset()
s.draw('a'*(s.columns - 2)), s.draw('😛'), s.linefeed(), s.carriage_return(), s.draw('123')
s.resize(s.lines, s.columns-1)
self.ae('\x1b[maaaa\x1b[m😛\n\x1b[m123', as_ansi().rstrip()) # ]]]]]]]

reset()
s.draw('a'*(s.columns - 1)), s.draw('😛'), s.draw('bcd')
s.resize(s.lines, s.columns + 1)
Expand All @@ -512,3 +517,22 @@ def reset():
ac(s.columns-1, 0, next_char_was_wrapped=True)
s.resize(s.lines, s.columns + 1)
self.ae('\x1b[maaaaaa😛\x1b[mbcd', as_ansi().rstrip()) # ]]]]]]]

reset()
s.draw('a'*(s.columns - 1)), multicell(s, 'X', scale=2), s.draw('bcd')
s.resize(s.lines, s.columns + 1)
self.ae('\x1b[maaaaa\x1b]66;w=1:s=2;X\x07\x1b[mbcd', as_ansi().rstrip()) # ]]]]]]]
for y in (0, 1):
for x in (1, 2):
ac(s.columns-x, y, is_multicell=True)
for x in (0, 1):
ac(x, y, is_multicell=False)
reset()
s.draw('a'*(s.columns - 1)), multicell(s, 'X', scale=2), s.draw('bcd1234!')
s.resize(s.lines, s.columns + 2)
self.ae('\x1b[maaaaa\x1b]66;w=1:s=2;X\x07b\x1b[mcd1234\x1b[m!', as_ansi().rstrip()) # ]]]]]]]
for y in (0, 1):
for x in (1, 2):
ac(s.columns-x -1, y, is_multicell=True)
for x in (0, 1):
ac(x, y, is_multicell=False)

0 comments on commit 2f45d13

Please sign in to comment.