mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
test(api/window_spec): remove duplicate test (#30538)
(cherry picked from commit eea6b84a87
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
c9d7ad4a34
commit
6a0d1eee46
@@ -2765,43 +2765,11 @@ describe('API/win', function()
|
|||||||
border = 'single',
|
border = 'single',
|
||||||
})
|
})
|
||||||
eq(
|
eq(
|
||||||
'title/footer cannot be an empty array',
|
'title/footer must be string or array',
|
||||||
pcall_err(api.nvim_win_set_config, win, { title = {} })
|
pcall_err(api.nvim_win_set_config, win, { title = 0 })
|
||||||
)
|
)
|
||||||
command('redraw!')
|
command('redraw!')
|
||||||
assert_alive()
|
assert_alive()
|
||||||
end)
|
|
||||||
|
|
||||||
it('no crash with invalid footer', function()
|
|
||||||
local win = api.nvim_open_win(0, true, {
|
|
||||||
width = 10,
|
|
||||||
height = 10,
|
|
||||||
relative = 'editor',
|
|
||||||
row = 10,
|
|
||||||
col = 10,
|
|
||||||
footer = { { 'test' } },
|
|
||||||
border = 'single',
|
|
||||||
})
|
|
||||||
eq(
|
|
||||||
'title/footer cannot be an empty array',
|
|
||||||
pcall_err(api.nvim_win_set_config, win, { footer = {} })
|
|
||||||
)
|
|
||||||
command('redraw!')
|
|
||||||
assert_alive()
|
|
||||||
end)
|
|
||||||
end)
|
|
||||||
|
|
||||||
describe('set_config', function()
|
|
||||||
it('no crash with invalid title', function()
|
|
||||||
local win = api.nvim_open_win(0, true, {
|
|
||||||
width = 10,
|
|
||||||
height = 10,
|
|
||||||
relative = 'editor',
|
|
||||||
row = 10,
|
|
||||||
col = 10,
|
|
||||||
title = { { 'test' } },
|
|
||||||
border = 'single',
|
|
||||||
})
|
|
||||||
eq(
|
eq(
|
||||||
'title/footer cannot be an empty array',
|
'title/footer cannot be an empty array',
|
||||||
pcall_err(api.nvim_win_set_config, win, { title = {} })
|
pcall_err(api.nvim_win_set_config, win, { title = {} })
|
||||||
@@ -2820,6 +2788,12 @@ describe('API/win', function()
|
|||||||
footer = { { 'test' } },
|
footer = { { 'test' } },
|
||||||
border = 'single',
|
border = 'single',
|
||||||
})
|
})
|
||||||
|
eq(
|
||||||
|
'title/footer must be string or array',
|
||||||
|
pcall_err(api.nvim_win_set_config, win, { footer = 0 })
|
||||||
|
)
|
||||||
|
command('redraw!')
|
||||||
|
assert_alive()
|
||||||
eq(
|
eq(
|
||||||
'title/footer cannot be an empty array',
|
'title/footer cannot be an empty array',
|
||||||
pcall_err(api.nvim_win_set_config, win, { footer = {} })
|
pcall_err(api.nvim_win_set_config, win, { footer = {} })
|
||||||
|
Reference in New Issue
Block a user