aboutsummaryrefslogtreecommitdiff
path: root/test/functional/provider
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/provider')
-rw-r--r--test/functional/provider/provider_spec.lua11
-rw-r--r--test/functional/provider/python3_spec.lua7
-rw-r--r--test/functional/provider/python_spec.lua7
-rw-r--r--test/functional/provider/ruby_spec.lua7
4 files changed, 18 insertions, 14 deletions
diff --git a/test/functional/provider/provider_spec.lua b/test/functional/provider/provider_spec.lua
index bfb0bbc3a3..78bc4a4edb 100644
--- a/test/functional/provider/provider_spec.lua
+++ b/test/functional/provider/provider_spec.lua
@@ -2,7 +2,8 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, eval = helpers.clear, helpers.eval
local command = helpers.command
-local expect_err = helpers.expect_err
+local eq = helpers.eq
+local pcall_err = helpers.pcall_err
describe('providers', function()
before_each(function()
@@ -13,14 +14,14 @@ describe('providers', function()
command('set loadplugins')
-- Using test-fixture with broken impl:
-- test/functional/fixtures/autoload/provider/python.vim
- expect_err('Vim:provider: python: missing required variable g:loaded_python_provider',
- eval, "has('python')")
+ eq('Vim:provider: python: missing required variable g:loaded_python_provider',
+ pcall_err(eval, "has('python')"))
end)
it('with g:loaded_xx_provider, missing #Call()', function()
-- Using test-fixture with broken impl:
-- test/functional/fixtures/autoload/provider/ruby.vim
- expect_err('Vim:provider: ruby: g:loaded_ruby_provider=2 but provider#ruby#Call is not defined',
- eval, "has('ruby')")
+ eq('Vim:provider: ruby: g:loaded_ruby_provider=2 but provider#ruby#Call is not defined',
+ pcall_err(eval, "has('ruby')"))
end)
end)
diff --git a/test/functional/provider/python3_spec.lua b/test/functional/provider/python3_spec.lua
index f4b1b0e4dc..d7ca0bd420 100644
--- a/test/functional/provider/python3_spec.lua
+++ b/test/functional/provider/python3_spec.lua
@@ -2,18 +2,19 @@ local helpers = require('test.functional.helpers')(after_each)
local eval, command, feed = helpers.eval, helpers.command, helpers.feed
local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert
local expect, write_file = helpers.expect, helpers.write_file
-local expect_err = helpers.expect_err
local feed_command = helpers.feed_command
local source = helpers.source
local missing_provider = helpers.missing_provider
+local matches = helpers.matches
+local pcall_err = helpers.pcall_err
do
clear()
if missing_provider('python3') then
it(':python3 reports E319 if provider is missing', function()
local expected = [[Vim%(py3.*%):E319: No "python3" provider found.*]]
- expect_err(expected, command, 'py3 print("foo")')
- expect_err(expected, command, 'py3file foo')
+ matches(expected, pcall_err(command, 'py3 print("foo")'))
+ matches(expected, pcall_err(command, 'py3file foo'))
end)
pending('Python 3 (or the pynvim module) is broken/missing', function() end)
return
diff --git a/test/functional/provider/python_spec.lua b/test/functional/provider/python_spec.lua
index 869cfd1721..eab4b29d3a 100644
--- a/test/functional/provider/python_spec.lua
+++ b/test/functional/provider/python_spec.lua
@@ -8,20 +8,21 @@ local funcs = helpers.funcs
local meths = helpers.meths
local insert = helpers.insert
local expect = helpers.expect
-local expect_err = helpers.expect_err
local command = helpers.command
local exc_exec = helpers.exc_exec
local write_file = helpers.write_file
local curbufmeths = helpers.curbufmeths
local missing_provider = helpers.missing_provider
+local matches = helpers.matches
+local pcall_err = helpers.pcall_err
do
clear()
if missing_provider('python') then
it(':python reports E319 if provider is missing', function()
local expected = [[Vim%(py.*%):E319: No "python" provider found.*]]
- expect_err(expected, command, 'py print("foo")')
- expect_err(expected, command, 'pyfile foo')
+ matches(expected, pcall_err(command, 'py print("foo")'))
+ matches(expected, pcall_err(command, 'pyfile foo'))
end)
pending('Python 2 (or the pynvim module) is broken/missing', function() end)
return
diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua
index 72802db3c9..d20adde2ef 100644
--- a/test/functional/provider/ruby_spec.lua
+++ b/test/functional/provider/ruby_spec.lua
@@ -6,22 +6,23 @@ local curbufmeths = helpers.curbufmeths
local eq = helpers.eq
local eval = helpers.eval
local expect = helpers.expect
-local expect_err = helpers.expect_err
local feed = helpers.feed
local feed_command = helpers.feed_command
local funcs = helpers.funcs
local insert = helpers.insert
local meths = helpers.meths
local missing_provider = helpers.missing_provider
+local matches = helpers.matches
local write_file = helpers.write_file
+local pcall_err = helpers.pcall_err
do
clear()
if missing_provider('ruby') then
it(':ruby reports E319 if provider is missing', function()
local expected = [[Vim%(ruby.*%):E319: No "ruby" provider found.*]]
- expect_err(expected, command, 'ruby puts "foo"')
- expect_err(expected, command, 'rubyfile foo')
+ matches(expected, pcall_err(command, 'ruby puts "foo"'))
+ matches(expected, pcall_err(command, 'rubyfile foo'))
end)
pending("Missing neovim RubyGem.", function() end)
return