aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/api')
-rw-r--r--test/functional/api/menu_spec.lua2
-rw-r--r--test/functional/api/server_requests_spec.lua6
-rw-r--r--test/functional/api/vim_spec.lua20
-rw-r--r--test/functional/api/window_spec.lua8
4 files changed, 13 insertions, 23 deletions
diff --git a/test/functional/api/menu_spec.lua b/test/functional/api/menu_spec.lua
index 34d23ca098..5b414fb559 100644
--- a/test/functional/api/menu_spec.lua
+++ b/test/functional/api/menu_spec.lua
@@ -19,7 +19,7 @@ describe("update_menu notification", function()
screen:detach()
end)
- function expect_sent(expected)
+ local function expect_sent(expected)
screen:wait(function()
if screen.update_menu ~= expected then
if expected then
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua
index 34bf4b5ace..a3ac864f79 100644
--- a/test/functional/api/server_requests_spec.lua
+++ b/test/functional/api/server_requests_spec.lua
@@ -95,13 +95,13 @@ describe('server -> client', function()
eq('notified!', eval('rpcrequest('..cid..', "notify")'))
end
- local function on_request(method, args)
+ local function on_request(method)
eq('notify', method)
eq(1, eval('rpcnotify('..cid..', "notification")'))
return 'notified!'
end
- local function on_notification(method, args)
+ local function on_notification(method)
eq('notification', method)
if notified == expected then
stop()
@@ -118,7 +118,7 @@ describe('server -> client', function()
describe('when the client is a recursive vim instance', function()
before_each(function()
- nvim('command', "let vim = rpcstart('"..nvim_prog.."', ['-u', 'NONE', '--embed'])")
+ nvim('command', "let vim = rpcstart('"..nvim_prog.."', ['-u', 'NONE', '-i', 'NONE', '--cmd', 'set noswapfile', '--embed'])")
neq(0, eval('vim'))
end)
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 8d4e183653..cba0b7533b 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -180,6 +180,8 @@ describe('vim_* functions', function()
end)
describe('err_write', function()
+ local screen
+
before_each(function()
clear()
screen = Screen.new(40, 8)
@@ -247,33 +249,21 @@ describe('vim_* functions', function()
~ |
{1:very fail} |
]])
+ helpers.wait()
-- shows up to &cmdheight lines
- nvim_async('err_write', 'more fail\n')
- nvim_async('err_write', 'too fail\n')
+ nvim_async('err_write', 'more fail\ntoo fail\n')
screen:expect([[
~ |
~ |
~ |
~ |
~ |
- {1:very fail} |
- {1:more fail} |
- {2:Press ENTER or type command to continue}^ |
- ]])
-
- -- shows the rest after return
- feed('<cr>')
- screen:expect([[
- ~ |
- ~ |
- ~ |
- {1:very fail} |
{1:more fail} |
- {2:Press ENTER or type command to continue} |
{1:too fail} |
{2:Press ENTER or type command to continue}^ |
]])
+ feed('<cr>') -- exit the press ENTER screen
end)
end)
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua
index 456252522d..17aacafe9b 100644
--- a/test/functional/api/window_spec.lua
+++ b/test/functional/api/window_spec.lua
@@ -1,9 +1,9 @@
-- Sanity checks for window_* API calls via msgpack-rpc
local helpers = require('test.functional.helpers')
-local clear, nvim, buffer, curbuf, curbuf_contents, window, curwin, eq, neq,
- ok, feed, rawfeed, insert, eval = helpers.clear, helpers.nvim, helpers.buffer, helpers.curbuf,
+local clear, nvim, curbuf, curbuf_contents, window, curwin, eq, neq,
+ ok, feed, insert, eval = helpers.clear, helpers.nvim, helpers.curbuf,
helpers.curbuf_contents, helpers.window, helpers.curwin, helpers.eq,
- helpers.neq, helpers.ok, helpers.feed, helpers.rawfeed, helpers.insert, helpers.eval
+ helpers.neq, helpers.ok, helpers.feed, helpers.insert, helpers.eval
local wait = helpers.wait
-- check if str is visible at the beginning of some line
@@ -54,7 +54,7 @@ describe('window_* functions', function()
insert("prologue")
feed('100o<esc>')
insert("epilogue")
- win = curwin()
+ local win = curwin()
feed('gg')
wait() -- let nvim process the 'gg' command