aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua21
1 files changed, 8 insertions, 13 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index b8d912114d..655200e6f7 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -14,8 +14,10 @@ local check_cores = global_helpers.check_cores
local check_logs = global_helpers.check_logs
local neq = global_helpers.neq
local eq = global_helpers.eq
+local expect_err = global_helpers.expect_err
local ok = global_helpers.ok
local map = global_helpers.map
+local matches = global_helpers.matches
local filter = global_helpers.filter
local dedent = global_helpers.dedent
local table_flatten = global_helpers.table_flatten
@@ -304,12 +306,10 @@ local function retry(max, max_ms, fn)
end
luv.update_time() -- Update cached value of luv.now() (libuv: uv_now()).
if (max and tries >= max) or (luv.now() - start_time > timeout) then
- if type(result) == "string" then
- result = "\nretry() attempts: "..tostring(tries).."\n"..result
- end
- error(result)
+ error("\nretry() attempts: "..tostring(tries).."\n"..tostring(result))
end
tries = tries + 1
+ luv.sleep(20) -- Avoid hot loop...
end
end
@@ -425,7 +425,7 @@ end
local function set_shell_powershell()
source([[
set shell=powershell shellquote=( shellpipe=\| shellredir=> shellxquote=
- set shellcmdflag=-NoLogo\ -NoProfile\ -ExecutionPolicy\ RemoteSigned\ -Command
+ let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command Remove-Item -Force alias:sleep;'
]])
end
@@ -468,14 +468,7 @@ end
-- sleeps the test runner (_not_ the nvim instance)
local function sleep(ms)
- local function notification_cb(method, _)
- if method == "redraw" then
- error("Screen is attached; use screen:sleep() instead.")
- end
- return true
- end
-
- run(nil, notification_cb, nil, ms)
+ luv.sleep(ms)
end
local function curbuf_contents()
@@ -736,6 +729,7 @@ local module = {
exc_exec = exc_exec,
expect = expect,
expect_any = expect_any,
+ expect_err = expect_err,
expect_msg_seq = expect_msg_seq,
expect_twostreams = expect_twostreams,
feed = feed,
@@ -747,6 +741,7 @@ local module = {
insert = insert,
iswin = iswin,
map = map,
+ matches = matches,
merge_args = merge_args,
meth_pcall = meth_pcall,
meths = meths,