test(tui_spec): use Unicode in cursor_address test (#30807)

Now that #16425 is fixed, use Unicode again to reduce screen height.
Unfortunately composing chars still can't be used, as it turns out that
composing chars may be missing when sent separately from the base char
at the last char a screen line.
This commit is contained in:
zeertzjq 2024-10-14 14:10:14 +08:00 committed by GitHub
parent a6d5e6b105
commit 1189c5ce59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,6 @@ local eq = t.eq
local feed_data = tt.feed_data
local clear = n.clear
local command = n.command
local dedent = t.dedent
local exec = n.exec
local exec_lua = n.exec_lua
local testprg = n.testprg
@ -1853,19 +1852,19 @@ describe('TUI', function()
end)
it('draws correctly when cursor_address overflows #21643', function()
t.skip(is_os('mac'), 'FIXME: crashes/errors on macOS')
screen:try_resize(77, 855)
screen:try_resize(70, 333)
retry(nil, nil, function()
eq({ true, 852 }, { child_session:request('nvim_win_get_height', 0) })
eq({ true, 330 }, { child_session:request('nvim_win_get_height', 0) })
end)
-- Use full screen message so that redrawing afterwards is more deterministic.
child_session:notify('nvim_command', 'intro')
screen:expect({ any = 'Nvim' })
screen:expect({ any = 'Nvim is open source and freely distributable' })
-- Going to top-left corner needs 3 bytes.
-- Setting underline attribute needs 9 bytes.
-- The whole line needs 3 + 9 + 65513 + 3 = 65528 bytes.
-- A Ꝩ character takes 3 bytes.
-- The whole line needs 3 + 9 + 3 * 21838 + 3 = 65529 bytes.
-- The cursor_address that comes after will overflow the 65535-byte buffer.
local line = ('a'):rep(65513) .. ''
local line = (''):rep(21838) .. ''
child_session:notify(
'nvim_exec_lua',
[[
@ -1876,22 +1875,16 @@ describe('TUI', function()
)
-- Close the :intro message and redraw the lines.
feed_data('\n')
screen:expect(
'{13:a}{12:'
.. ('a'):rep(76)
.. '}|\n'
.. ('{12:' .. ('a'):rep(77) .. '}|\n'):rep(849)
.. '{12:'
.. ('a'):rep(63)
.. ''
.. (' '):rep(13)
.. '}|\n'
.. dedent([[
screen:expect([[
{13:}{12:}|
{12:}|*310
{12: }|
b |
{4:~ }|*17
{5:[No Name] [+] }|
|
{3:-- TERMINAL --} |]])
)
{3:-- TERMINAL --} |
]])
end)
it('visual bell (padding) does not crash #21610', function()