mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
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.
(cherry picked from commit 1189c5ce59
)
This commit is contained in:
committed by
github-actions[bot]
parent
1a02f1835f
commit
97aaea3478
@ -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
|
||||
@ -1744,19 +1743,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',
|
||||
[[
|
||||
@ -1767,22 +1766,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([[
|
||||
b |
|
||||
{5:[No Name] [+] }|
|
||||
|
|
||||
{3:-- TERMINAL --} |]])
|
||||
)
|
||||
screen:expect([[
|
||||
{13:Ꝩ}{12:ꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨ}|
|
||||
{12:ꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨ}|*310
|
||||
{12:ꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨꝨ℃ }|
|
||||
b |
|
||||
{4:~ }|*17
|
||||
{5:[No Name] [+] }|
|
||||
|
|
||||
{3:-- TERMINAL --} |
|
||||
]])
|
||||
end)
|
||||
|
||||
it('visual bell (padding) does not crash #21610', function()
|
||||
|
Reference in New Issue
Block a user