aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-11-13 14:52:19 +0100
committerGitHub <noreply@github.com>2022-11-13 05:52:19 -0800
commit736c36c02f316c979da363c5120495179a2b6c2a (patch)
tree97015d6701788a2c0b37b92c25033fff4f779ab9 /test/functional/core
parent0a96f18ed774ebc27db50eba4d8a4437e970a331 (diff)
downloadrneovim-736c36c02f316c979da363c5120495179a2b6c2a.tar.gz
rneovim-736c36c02f316c979da363c5120495179a2b6c2a.tar.bz2
rneovim-736c36c02f316c979da363c5120495179a2b6c2a.zip
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())`.
Diffstat (limited to 'test/functional/core')
-rw-r--r--test/functional/core/channels_spec.lua6
-rw-r--r--test/functional/core/fileio_spec.lua21
-rw-r--r--test/functional/core/job_spec.lua11
-rw-r--r--test/functional/core/main_spec.lua4
4 files changed, 19 insertions, 23 deletions
diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua
index ca52404d3b..63bd85ff43 100644
--- a/test/functional/core/channels_spec.lua
+++ b/test/functional/core/channels_spec.lua
@@ -12,6 +12,8 @@ local retry = helpers.retry
local expect_twostreams = helpers.expect_twostreams
local assert_alive = helpers.assert_alive
local pcall_err = helpers.pcall_err
+local iswin = helpers.iswin
+local skip = helpers.skip
describe('channels', function()
local init = [[
@@ -145,7 +147,7 @@ describe('channels', function()
end
it('can use stdio channel with pty', function()
- if helpers.pending_win32(pending) then return end
+ skip(iswin())
source([[
let g:job_opts = {
\ 'on_stdout': function('OnEvent'),
@@ -199,7 +201,7 @@ describe('channels', function()
it('stdio channel can use rpc and stderr simultaneously', function()
- if helpers.pending_win32(pending) then return end
+ skip(iswin())
source([[
let g:job_opts = {
\ 'on_stderr': function('OnEvent'),
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua
index 795f639dad..00b9074e29 100644
--- a/test/functional/core/fileio_spec.lua
+++ b/test/functional/core/fileio_spec.lua
@@ -28,6 +28,7 @@ local write_file = helpers.write_file
local Screen = require('test.functional.ui.screen')
local feed_command = helpers.feed_command
local isCI = helpers.isCI
+local skip = helpers.skip
describe('fileio', function()
before_each(function()
@@ -89,9 +90,7 @@ describe('fileio', function()
end)
it('backup #9709', function()
- if isCI('cirrus') then
- pending('FIXME: cirrus')
- end
+ skip(isCI('cirrus'))
clear({ args={ '-i', 'Xtest_startup_shada',
'--cmd', 'set directory=Xtest_startup_swapdir' } })
@@ -111,9 +110,7 @@ describe('fileio', function()
end)
it('backup with full path #11214', function()
- if isCI('cirrus') then
- pending('FIXME: cirrus')
- end
+ skip(isCI('cirrus'))
clear()
mkdir('Xtest_backupdir')
command('set backup')
@@ -135,9 +132,7 @@ describe('fileio', function()
end)
it('backup symlinked files #11349', function()
- if isCI('cirrus') then
- pending('FIXME: cirrus')
- end
+ skip(isCI('cirrus'))
clear()
local initial_content = 'foo'
@@ -159,9 +154,7 @@ describe('fileio', function()
it('backup symlinked files in first avialable backupdir #11349', function()
- if isCI('cirrus') then
- pending('FIXME: cirrus')
- end
+ skip(isCI('cirrus'))
clear()
local initial_content = 'foo'
@@ -306,9 +299,7 @@ describe('tmpdir', function()
end)
-- "…/nvim.<user>/" has wrong permissions:
- if iswin() then
- return -- TODO(justinmk): need setfperm/getfperm on Windows. #8244
- end
+ skip(iswin(), 'TODO(justinmk): need setfperm/getfperm on Windows. #8244')
os.remove(testlog)
os.remove(tmproot)
mkdir(tmproot)
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 02ff18bdda..4e5c4ca351 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -23,6 +23,7 @@ local expect_msg_seq = helpers.expect_msg_seq
local pcall_err = helpers.pcall_err
local matches = helpers.matches
local Screen = require('test.functional.ui.screen')
+local skip = helpers.skip
describe('jobs', function()
local channel
@@ -87,7 +88,7 @@ describe('jobs', function()
end)
it('append environment with pty #env', function()
- if helpers.pending_win32(pending) then return end
+ skip(iswin())
nvim('command', "let $VAR = 'abc'")
nvim('command', "let $TOTO = 'goodbye world'")
nvim('command', "let g:job_opts.pty = v:true")
@@ -225,7 +226,7 @@ describe('jobs', function()
end)
it('error on non-executable `cwd`', function()
- if iswin() then return end -- N/A for Windows
+ skip(iswin(), 'Not applicable for Windows')
local dir = 'Xtest_not_executable_dir'
mkdir(dir)
@@ -805,7 +806,7 @@ describe('jobs', function()
end)
it('can be called recursively', function()
- if helpers.pending_win32(pending) then return end -- TODO: Need `cat`.
+ skip(iswin(), "TODO: Need `cat`")
source([[
let g:opts = {}
let g:counter = 0
@@ -1027,7 +1028,7 @@ describe('jobs', function()
end)
describe('running tty-test program', function()
- if helpers.pending_win32(pending) then return end
+ if skip(iswin()) then return end
local function next_chunk()
local rv
while true do
@@ -1124,7 +1125,7 @@ describe("pty process teardown", function()
end)
it("does not prevent/delay exit. #4798 #4900", function()
- if helpers.pending_win32(pending) then return end
+ skip(iswin())
-- Use a nested nvim (in :term) to test without --headless.
feed_command(":terminal '"..helpers.nvim_prog
.."' -u NONE -i NONE --cmd '"..nvim_set.."' "
diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua
index f6fb859ccc..782a03bfed 100644
--- a/test/functional/core/main_spec.lua
+++ b/test/functional/core/main_spec.lua
@@ -9,6 +9,8 @@ local clear = helpers.clear
local funcs = helpers.funcs
local nvim_prog_abs = helpers.nvim_prog_abs
local write_file = helpers.write_file
+local iswin = helpers.iswin
+local skip = helpers.skip
describe('Command-line option', function()
describe('-s', function()
@@ -49,7 +51,7 @@ describe('Command-line option', function()
eq(#('100500\n'), attrs.size)
end)
it('does not crash after reading from stdin in non-headless mode', function()
- if helpers.pending_win32(pending) then return end
+ skip(iswin())
local screen = Screen.new(40, 8)
screen:attach()
local args = {