From 736c36c02f316c979da363c5120495179a2b6c2a Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 13 Nov 2022 14:52:19 +0100 Subject: test: introduce skip() #21010 This is essentially a convenience wrapper around the `pending()` function, similar to `skip_fragile()` but more general-purpose. Also remove `pending_win32` function as it can be replaced by `skip(iswin())`. --- test/functional/terminal/window_spec.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test/functional/terminal/window_spec.lua') diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua index 0d3295cf32..81cd1017db 100644 --- a/test/functional/terminal/window_spec.lua +++ b/test/functional/terminal/window_spec.lua @@ -8,6 +8,7 @@ local command = helpers.command local retry = helpers.retry local eq = helpers.eq local eval = helpers.eval +local skip = helpers.skip describe(':terminal window', function() local screen @@ -18,7 +19,7 @@ describe(':terminal window', function() end) it('sets topline correctly #8556', function() - if helpers.pending_win32(pending) then return end + skip(iswin()) -- Test has hardcoded assumptions of dimensions. eq(7, eval('&lines')) feed_data('\n\n\n') -- Add blank lines. @@ -54,9 +55,7 @@ describe(':terminal window', function() {3:-- TERMINAL --} | ]]) - if iswin() then - return -- win: :terminal resize is unreliable #7007 - end + skip(iswin(), 'win: :terminal resize is unreliable #7007') -- numberwidth=9 feed([[]]) -- cgit From 5eb5f4948826e9d47685ea9e257409cc3e693614 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 22 Nov 2022 01:13:30 +0100 Subject: test: simplify platform detection (#21020) Extend the capabilities of is_os to detect more platforms such as freebsd and openbsd. Also remove `iswin()` helper function as it can be replaced by `is_os("win")`. --- test/functional/terminal/window_spec.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/functional/terminal/window_spec.lua') diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua index 81cd1017db..80e9d78400 100644 --- a/test/functional/terminal/window_spec.lua +++ b/test/functional/terminal/window_spec.lua @@ -3,12 +3,12 @@ local thelpers = require('test.functional.terminal.helpers') local feed_data = thelpers.feed_data local feed, clear = helpers.feed, helpers.clear local poke_eventloop = helpers.poke_eventloop -local iswin = helpers.iswin local command = helpers.command local retry = helpers.retry local eq = helpers.eq local eval = helpers.eval local skip = helpers.skip +local is_os = helpers.is_os describe(':terminal window', function() local screen @@ -19,7 +19,7 @@ describe(':terminal window', function() end) it('sets topline correctly #8556', function() - skip(iswin()) + skip(is_os('win')) -- Test has hardcoded assumptions of dimensions. eq(7, eval('&lines')) feed_data('\n\n\n') -- Add blank lines. @@ -55,7 +55,7 @@ describe(':terminal window', function() {3:-- TERMINAL --} | ]]) - skip(iswin(), 'win: :terminal resize is unreliable #7007') + skip(is_os('win'), 'win: :terminal resize is unreliable #7007') -- numberwidth=9 feed([[]]) @@ -171,7 +171,7 @@ describe(':terminal with multigrid', function() ]]) screen:try_resize_grid(2, 20, 10) - if iswin() then + if is_os('win') then screen:expect{any="rows: 10, cols: 20"} else screen:expect([[ @@ -200,7 +200,7 @@ describe(':terminal with multigrid', function() end screen:try_resize_grid(2, 70, 3) - if iswin() then + if is_os('win') then screen:expect{any="rows: 3, cols: 70"} else screen:expect([[ @@ -222,7 +222,7 @@ describe(':terminal with multigrid', function() end screen:try_resize_grid(2, 0, 0) - if iswin() then + if is_os('win') then screen:expect{any="rows: 6, cols: 50"} else screen:expect([[ -- cgit