From db914e8b6139e111ed0a744f78a704f35e1774ba Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Tue, 25 Nov 2014 05:36:21 -0500 Subject: [PATCH] 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. --- test/functional/api/window_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index 4c867d2f5d..f3ac90de21 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -104,7 +104,7 @@ describe('window_* functions', function() nvim('set_current_window', nvim('get_windows')[2]) nvim('command', 'split') 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) eq(2, window('get_height', nvim('get_windows')[2])) end) @@ -118,7 +118,7 @@ describe('window_* functions', function() nvim('set_current_window', nvim('get_windows')[2]) nvim('command', 'vsplit') 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) eq(2, window('get_width', nvim('get_windows')[2])) end)