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:
John Szakmeister
2014-11-25 05:36:21 -05:00
parent bcab2905d8
commit db914e8b61

View File

@@ -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)