aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-03-09 00:24:38 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-03-11 12:43:42 +0100
commitfd4021387e696c7a2da4ad776789cfbb938d5332 (patch)
tree9258c5beb797c4de4231a9c4dec1f51c92fbfcc5
parentd554a6c7f0e9ed84f2e16d4977740a1584d11198 (diff)
downloadrneovim-fd4021387e696c7a2da4ad776789cfbb938d5332.tar.gz
rneovim-fd4021387e696c7a2da4ad776789cfbb938d5332.tar.bz2
rneovim-fd4021387e696c7a2da4ad776789cfbb938d5332.zip
test: rename next_message() to next_msg()
-rw-r--r--test/functional/api/server_notifications_spec.lua16
-rw-r--r--test/functional/api/server_requests_spec.lua10
-rw-r--r--test/functional/autocmd/cmdline_spec.lua2
-rw-r--r--test/functional/core/channels_spec.lua2
-rw-r--r--test/functional/core/job_spec.lua2
-rw-r--r--test/functional/ex_cmds/dict_notifications_spec.lua2
-rw-r--r--test/functional/helpers.lua10
-rw-r--r--test/functional/ui/input_spec.lua4
8 files changed, 24 insertions, 24 deletions
diff --git a/test/functional/api/server_notifications_spec.lua b/test/functional/api/server_notifications_spec.lua
index 9d7cfb9b78..1d64ae7103 100644
--- a/test/functional/api/server_notifications_spec.lua
+++ b/test/functional/api/server_notifications_spec.lua
@@ -1,7 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
-local eq, clear, eval, command, nvim, next_message =
+local eq, clear, eval, command, nvim, next_msg =
helpers.eq, helpers.clear, helpers.eval, helpers.command, helpers.nvim,
- helpers.next_message
+ helpers.next_msg
local meths = helpers.meths
describe('notify', function()
@@ -15,10 +15,10 @@ describe('notify', function()
describe('passing a valid channel id', function()
it('sends the notification/args to the corresponding channel', function()
eval('rpcnotify('..channel..', "test-event", 1, 2, 3)')
- eq({'notification', 'test-event', {1, 2, 3}}, next_message())
+ eq({'notification', 'test-event', {1, 2, 3}}, next_msg())
command('au FileType lua call rpcnotify('..channel..', "lua!")')
command('set filetype=lua')
- eq({'notification', 'lua!', {}}, next_message())
+ eq({'notification', 'lua!', {}}, next_msg())
end)
end)
@@ -28,13 +28,13 @@ describe('notify', function()
eval('rpcnotify(0, "event1", 1, 2, 3)')
eval('rpcnotify(0, "event2", 4, 5, 6)')
eval('rpcnotify(0, "event2", 7, 8, 9)')
- eq({'notification', 'event2', {4, 5, 6}}, next_message())
- eq({'notification', 'event2', {7, 8, 9}}, next_message())
+ eq({'notification', 'event2', {4, 5, 6}}, next_msg())
+ eq({'notification', 'event2', {7, 8, 9}}, next_msg())
nvim('unsubscribe', 'event2')
nvim('subscribe', 'event1')
eval('rpcnotify(0, "event2", 10, 11, 12)')
eval('rpcnotify(0, "event1", 13, 14, 15)')
- eq({'notification', 'event1', {13, 14, 15}}, next_message())
+ eq({'notification', 'event1', {13, 14, 15}}, next_msg())
end)
it('does not crash for deeply nested variable', function()
@@ -42,7 +42,7 @@ describe('notify', function()
local nest_level = 1000
meths.command(('call map(range(%u), "extend(g:, {\'l\': [g:l]})")'):format(nest_level - 1))
eval('rpcnotify('..channel..', "event", g:l)')
- local msg = next_message()
+ local msg = next_msg()
eq('notification', msg[1])
eq('event', msg[2])
local act_ret = msg[3]
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua
index 37ac532d18..18229b54ff 100644
--- a/test/functional/api/server_requests_spec.lua
+++ b/test/functional/api/server_requests_spec.lua
@@ -6,7 +6,7 @@ local Paths = require('test.config.paths')
local clear, nvim, eval = helpers.clear, helpers.nvim, helpers.eval
local eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop
local nvim_prog, command, funcs = helpers.nvim_prog, helpers.command, helpers.funcs
-local source, next_message = helpers.source, helpers.next_message
+local source, next_msg = helpers.source, helpers.next_msg
local ok = helpers.ok
local meths = helpers.meths
local spawn, nvim_argv = helpers.spawn, helpers.nvim_argv
@@ -258,12 +258,12 @@ describe('server -> client', function()
it('rpc and text stderr can be combined', function()
eq("ok",funcs.rpcrequest(jobid, "poll"))
funcs.rpcnotify(jobid, "ping")
- eq({'notification', 'pong', {}}, next_message())
+ eq({'notification', 'pong', {}}, next_msg())
eq("done!",funcs.rpcrequest(jobid, "write_stderr", "fluff\n"))
- eq({'notification', 'stderr', {0, {'fluff', ''}}}, next_message())
+ eq({'notification', 'stderr', {0, {'fluff', ''}}}, next_msg())
funcs.rpcrequest(jobid, "exit")
- eq({'notification', 'stderr', {0, {''}}}, next_message())
- eq({'notification', 'exit', {0, 0}}, next_message())
+ eq({'notification', 'stderr', {0, {''}}}, next_msg())
+ eq({'notification', 'exit', {0, 0}}, next_msg())
end)
end)
diff --git a/test/functional/autocmd/cmdline_spec.lua b/test/functional/autocmd/cmdline_spec.lua
index 8d56687f7d..8ea086fb46 100644
--- a/test/functional/autocmd/cmdline_spec.lua
+++ b/test/functional/autocmd/cmdline_spec.lua
@@ -5,7 +5,7 @@ local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
local expect = helpers.expect
-local next_msg = helpers.next_message
+local next_msg = helpers.next_msg
local feed = helpers.feed
local meths = helpers.meths
diff --git a/test/functional/core/channels_spec.lua b/test/functional/core/channels_spec.lua
index e9fc88c01b..f79f208b69 100644
--- a/test/functional/core/channels_spec.lua
+++ b/test/functional/core/channels_spec.lua
@@ -1,7 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, eq, eval, next_msg, ok, source = helpers.clear, helpers.eq,
- helpers.eval, helpers.next_message, helpers.ok, helpers.source
+ helpers.eval, helpers.next_msg, helpers.ok, helpers.source
local command, funcs, meths = helpers.command, helpers.funcs, helpers.meths
local sleep = helpers.sleep
local spawn, nvim_argv = helpers.spawn, helpers.nvim_argv
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index e260069ea7..c5326aedfe 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local clear, eq, eval, exc_exec, feed_command, feed, insert, neq, next_msg, nvim,
nvim_dir, ok, source, write_file, mkdir, rmdir = helpers.clear,
helpers.eq, helpers.eval, helpers.exc_exec, helpers.feed_command, helpers.feed,
- helpers.insert, helpers.neq, helpers.next_message, helpers.nvim,
+ helpers.insert, helpers.neq, helpers.next_msg, helpers.nvim,
helpers.nvim_dir, helpers.ok, helpers.source,
helpers.write_file, helpers.mkdir, helpers.rmdir
local command = helpers.command
diff --git a/test/functional/ex_cmds/dict_notifications_spec.lua b/test/functional/ex_cmds/dict_notifications_spec.lua
index e3b4a1c504..3d550588e7 100644
--- a/test/functional/ex_cmds/dict_notifications_spec.lua
+++ b/test/functional/ex_cmds/dict_notifications_spec.lua
@@ -1,6 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, nvim, source = helpers.clear, helpers.nvim, helpers.source
-local eq, next_msg = helpers.eq, helpers.next_message
+local eq, next_msg = helpers.eq, helpers.next_msg
local exc_exec = helpers.exc_exec
local command = helpers.command
local eval = helpers.eval
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 1f53200dd8..72b086c574 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -97,14 +97,14 @@ local function request(method, ...)
return rv
end
-local function next_message(timeout)
+local function next_msg(timeout)
return session:next_message(timeout)
end
local function expect_twostreams(msgs1, msgs2)
local pos1, pos2 = 1, 1
while pos1 <= #msgs1 or pos2 <= #msgs2 do
- local msg = next_message()
+ local msg = next_msg()
if pos1 <= #msgs1 and pcall(eq, msgs1[pos1], msg) then
pos1 = pos1 + 1
elseif pos2 <= #msgs2 then
@@ -117,7 +117,7 @@ local function expect_twostreams(msgs1, msgs2)
end
end
--- Expects a sequence of next_message() results. If multiple sequences are
+-- Expects a sequence of next_msg() results. If multiple sequences are
-- passed they are tried until one succeeds, in order of shortest to longest.
local function expect_msg_seq(...)
if select('#', ...) < 1 then
@@ -140,7 +140,7 @@ local function expect_msg_seq(...)
local expected_seq = seqs[anum]
-- Collect enough messages to compare the next expected sequence.
while #actual_seq < #expected_seq do
- local msg = next_message(10000) -- Big timeout for ASAN/valgrind.
+ local msg = next_msg(10000) -- Big timeout for ASAN/valgrind.
if msg == nil then
error(cat_err(final_error,
string.format('got %d messages, expected %d',
@@ -754,7 +754,7 @@ local module = {
mkdir = lfs.mkdir,
neq = neq,
new_pipename = new_pipename,
- next_message = next_message,
+ next_msg = next_msg,
nvim = nvim,
nvim_argv = nvim_argv,
nvim_async = nvim_async,
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua
index 7d5521485c..8e62a37ef1 100644
--- a/test/functional/ui/input_spec.lua
+++ b/test/functional/ui/input_spec.lua
@@ -1,6 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, feed_command, nvim = helpers.clear, helpers.feed_command, helpers.nvim
-local feed, next_message, eq = helpers.feed, helpers.next_message, helpers.eq
+local feed, next_msg, eq = helpers.feed, helpers.next_msg, helpers.eq
local expect = helpers.expect
local write_file = helpers.write_file
local Screen = require('test.functional.ui.screen')
@@ -16,7 +16,7 @@ describe('mappings', function()
local check_mapping = function(mapping, expected)
feed(mapping)
- eq({'notification', 'mapped', {expected}}, next_message())
+ eq({'notification', 'mapped', {expected}}, next_msg())
end
before_each(function()