mirror of
https://github.com/neovim/neovim.git
synced 2025-11-05 02:04:29 +00:00
Fix broken functional test.
In Lua, all math is floating point. We need to coerce the result of a
division into a integer with the `{get,set}_height` and
`{get,set}_width` window_spec functional tests.
This commit is contained in:
@@ -104,7 +104,7 @@ describe('window_* functions', function()
|
|||||||
nvim('set_current_window', nvim('get_windows')[2])
|
nvim('set_current_window', nvim('get_windows')[2])
|
||||||
nvim('command', 'split')
|
nvim('command', 'split')
|
||||||
eq(window('get_height', nvim('get_windows')[2]),
|
eq(window('get_height', nvim('get_windows')[2]),
|
||||||
window('get_height', nvim('get_windows')[1]) / 2)
|
math.floor(window('get_height', nvim('get_windows')[1]) / 2))
|
||||||
window('set_height', nvim('get_windows')[2], 2)
|
window('set_height', nvim('get_windows')[2], 2)
|
||||||
eq(2, window('get_height', nvim('get_windows')[2]))
|
eq(2, window('get_height', nvim('get_windows')[2]))
|
||||||
end)
|
end)
|
||||||
@@ -118,7 +118,7 @@ describe('window_* functions', function()
|
|||||||
nvim('set_current_window', nvim('get_windows')[2])
|
nvim('set_current_window', nvim('get_windows')[2])
|
||||||
nvim('command', 'vsplit')
|
nvim('command', 'vsplit')
|
||||||
eq(window('get_width', nvim('get_windows')[2]),
|
eq(window('get_width', nvim('get_windows')[2]),
|
||||||
window('get_width', nvim('get_windows')[1]) / 2)
|
math.floor(window('get_width', nvim('get_windows')[1]) / 2))
|
||||||
window('set_width', nvim('get_windows')[2], 2)
|
window('set_width', nvim('get_windows')[2], 2)
|
||||||
eq(2, window('get_width', nvim('get_windows')[2]))
|
eq(2, window('get_width', nvim('get_windows')[2]))
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user