aboutsummaryrefslogtreecommitdiff
path: root/test/functional/provider
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 17:59:57 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 18:59:14 +0000
commit795f896a5772d5e0795f86642bdf90c82efac45c (patch)
tree308f04fbee18d2ec3f00c12a8bec96b84d8907f0 /test/functional/provider
parent4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (diff)
downloadrneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.gz
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.bz2
rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.zip
test: rename (meths, funcs) -> (api, fn)
Diffstat (limited to 'test/functional/provider')
-rw-r--r--test/functional/provider/clipboard_spec.lua6
-rw-r--r--test/functional/provider/define_spec.lua4
-rw-r--r--test/functional/provider/perl_spec.lua4
-rw-r--r--test/functional/provider/python3_spec.lua16
-rw-r--r--test/functional/provider/ruby_spec.lua18
5 files changed, 24 insertions, 24 deletions
diff --git a/test/functional/provider/clipboard_spec.lua b/test/functional/provider/clipboard_spec.lua
index 1b2e3ee689..0c4fd7aaa0 100644
--- a/test/functional/provider/clipboard_spec.lua
+++ b/test/functional/provider/clipboard_spec.lua
@@ -6,7 +6,7 @@ local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local feed_command, expect, eq, eval, source =
helpers.feed_command, helpers.expect, helpers.eq, helpers.eval, helpers.source
local command = helpers.command
-local meths = helpers.meths
+local api = helpers.api
local function basic_register_test(noblock)
insert('some words')
@@ -188,7 +188,7 @@ describe('clipboard', function()
it('valid g:clipboard', function()
-- provider#clipboard#Executable() only checks the structure.
- meths.nvim_set_var('clipboard', {
+ api.nvim_set_var('clipboard', {
['name'] = 'clippy!',
['copy'] = { ['+'] = 'any command', ['*'] = 'some other' },
['paste'] = { ['+'] = 'any command', ['*'] = 'some other' },
@@ -545,7 +545,7 @@ describe('clipboard (with fake clipboard.vim)', function()
eq({ { 'text', '' }, 'V' }, eval("g:test_clip['*']"))
command("let g:test_clip['*'] = [['star'], 'c']")
feed('p')
- eq('textstar', meths.nvim_get_current_line())
+ eq('textstar', api.nvim_get_current_line())
end)
it('Block paste works correctly', function()
diff --git a/test/functional/provider/define_spec.lua b/test/functional/provider/define_spec.lua
index 5f51ad76e6..a1109935d2 100644
--- a/test/functional/provider/define_spec.lua
+++ b/test/functional/provider/define_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local eval, command = helpers.eval, helpers.command
local eq, run, stop = helpers.eq, helpers.run, helpers.stop
local clear = helpers.clear
-local meths = helpers.meths
+local api = helpers.api
local function get_prefix(sync)
if sync then
@@ -362,7 +362,7 @@ local function function_specs_for(fn, sync, first_arg_factory, init)
end
local function channel()
- return meths.nvim_get_api_info()[1]
+ return api.nvim_get_api_info()[1]
end
local function host()
diff --git a/test/functional/provider/perl_spec.lua b/test/functional/provider/perl_spec.lua
index d0a9ea618e..e9a031eb07 100644
--- a/test/functional/provider/perl_spec.lua
+++ b/test/functional/provider/perl_spec.lua
@@ -5,7 +5,7 @@ local command = helpers.command
local write_file = helpers.write_file
local eval = helpers.eval
local retry = helpers.retry
-local meths = helpers.meths
+local api = helpers.api
local insert = helpers.insert
local expect = helpers.expect
local feed = helpers.feed
@@ -48,7 +48,7 @@ describe('legacy perl provider', function()
-- :perldo 1; doesn't change $_,
-- the buffer should not be changed
command('normal :perldo 1;')
- eq(false, meths.nvim_get_option_value('modified', {}))
+ eq(false, api.nvim_get_option_value('modified', {}))
-- insert some text
insert('abc\ndef\nghi')
expect([[
diff --git a/test/functional/provider/python3_spec.lua b/test/functional/provider/python3_spec.lua
index 8d81b86c9c..1419d7f651 100644
--- a/test/functional/provider/python3_spec.lua
+++ b/test/functional/provider/python3_spec.lua
@@ -8,7 +8,7 @@ local source = helpers.source
local missing_provider = helpers.missing_provider
local matches = helpers.matches
local pcall_err = helpers.pcall_err
-local funcs = helpers.funcs
+local fn = helpers.fn
local dedent = helpers.dedent
do
@@ -113,7 +113,7 @@ describe('python3 provider', function()
describe('py3eval()', function()
it('works', function()
- eq({ 1, 2, { ['key'] = 'val' } }, funcs.py3eval('[1, 2, {"key": "val"}]'))
+ eq({ 1, 2, { ['key'] = 'val' } }, fn.py3eval('[1, 2, {"key": "val"}]'))
end)
it('errors out when given non-string', function()
@@ -166,11 +166,11 @@ end)
describe('python2 feature test', function()
-- python2 is not supported, so correct behaviour is to return 0
it('works', function()
- eq(0, funcs.has('python2'))
- eq(0, funcs.has('python'))
- eq(0, funcs.has('python_compiled'))
- eq(0, funcs.has('python_dynamic'))
- eq(0, funcs.has('python_dynamic_'))
- eq(0, funcs.has('python_'))
+ eq(0, fn.has('python2'))
+ eq(0, fn.has('python'))
+ eq(0, fn.has('python_compiled'))
+ eq(0, fn.has('python_dynamic'))
+ eq(0, fn.has('python_dynamic_'))
+ eq(0, fn.has('python_'))
end)
end)
diff --git a/test/functional/provider/ruby_spec.lua b/test/functional/provider/ruby_spec.lua
index 2a64830bca..9b2531a23c 100644
--- a/test/functional/provider/ruby_spec.lua
+++ b/test/functional/provider/ruby_spec.lua
@@ -8,9 +8,9 @@ local exc_exec = helpers.exc_exec
local expect = helpers.expect
local feed = helpers.feed
local feed_command = helpers.feed_command
-local funcs = helpers.funcs
+local fn = helpers.fn
local insert = helpers.insert
-local meths = helpers.meths
+local api = helpers.api
local missing_provider = helpers.missing_provider
local matches = helpers.matches
local write_file = helpers.write_file
@@ -36,19 +36,19 @@ end)
describe('ruby feature test', function()
it('works', function()
- eq(1, funcs.has('ruby'))
+ eq(1, fn.has('ruby'))
end)
end)
describe(':ruby command', function()
it('evaluates ruby', function()
command('ruby VIM.command("let g:set_by_ruby = [100, 0]")')
- eq({ 100, 0 }, meths.nvim_get_var('set_by_ruby'))
+ eq({ 100, 0 }, api.nvim_get_var('set_by_ruby'))
end)
it('supports nesting', function()
command([[ruby VIM.command('ruby VIM.command("let set_by_nested_ruby = 555")')]])
- eq(555, meths.nvim_get_var('set_by_nested_ruby'))
+ eq(555, api.nvim_get_var('set_by_nested_ruby'))
end)
end)
@@ -57,7 +57,7 @@ describe(':rubyfile command', function()
local fname = 'rubyfile.rb'
write_file(fname, 'VIM.command("let set_by_rubyfile = 123")')
command('rubyfile rubyfile.rb')
- eq(123, meths.nvim_get_var('set_by_rubyfile'))
+ eq(123, api.nvim_get_var('set_by_rubyfile'))
os.remove(fname)
end)
end)
@@ -97,7 +97,7 @@ describe(':rubydo command', function()
it('does not modify the buffer if no changes are made', function()
command('normal :rubydo 42')
- eq(false, meths.nvim_get_option_value('modified', {}))
+ eq(false, api.nvim_get_option_value('modified', {}))
end)
end)
@@ -112,11 +112,11 @@ end)
describe('rubyeval()', function()
it('evaluates ruby objects', function()
- eq({ 1, 2, { ['key'] = 'val' } }, funcs.rubyeval('[1, 2, {key: "val"}]'))
+ eq({ 1, 2, { ['key'] = 'val' } }, fn.rubyeval('[1, 2, {key: "val"}]'))
end)
it('returns nil for empty strings', function()
- eq(vim.NIL, funcs.rubyeval(''))
+ eq(vim.NIL, fn.rubyeval(''))
end)
it('errors out when given non-string', function()