From 7973847d025aa7af431f1e92c1ee977ceb0eb7e5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 18 Feb 2018 19:22:44 +0100 Subject: test/util: remove eq_any() It was added in the parent commit, but ended up not being used. And I can't think of a case where it will be used: instead we would probably want to generalize expect_msg_seq() if necessary. --- test/functional/helpers.lua | 2 -- test/helpers.lua | 25 ++----------------------- 2 files changed, 2 insertions(+), 25 deletions(-) (limited to 'test') diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 3f3cdb56ba..a1da55ab1c 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -14,7 +14,6 @@ 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 eq_any = global_helpers.eq_any local ok = global_helpers.ok local map = global_helpers.map local filter = global_helpers.filter @@ -733,7 +732,6 @@ local module = { curwinmeths = curwinmeths, dedent = dedent, eq = eq, - eq_any = eq_any, eval = nvim_eval, exc_exec = exc_exec, expect = expect, diff --git a/test/helpers.lua b/test/helpers.lua index ee7dc5dfe5..91ceed4df1 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -10,28 +10,8 @@ local check_logs_useless_lines = { local function eq(expected, actual) return assert.are.same(expected, actual) end --- Tries multiple accepted ("expected") values until one succeeds. --- First N-1 arguments are the accepted values. --- Last (Nth) argument is the "actual" value to be compared. -local function eq_any(...) - if select('#', ...) < 2 then - error('need at least 2 arguments') - end - local args = {...} - local actual = args[#args] - local final_error = '' - for anum = 1, select('#', ...) - 1 do - local accepted = args[anum] - local status, result = pcall(eq, accepted, actual) - if status then - return result - end - final_error = final_error..tostring(result) - end - error(final_error) -end -local function neq(exp, act) - return assert.are_not.same(exp, act) +local function neq(expected, actual) + return assert.are_not.same(expected, actual) end local function ok(res) return assert.is_true(res) @@ -581,7 +561,6 @@ return { deepcopy = deepcopy, dictdiff = dictdiff, eq = eq, - eq_any = eq_any, filter = filter, fixtbl = fixtbl, fixtbl_rec = fixtbl_rec, -- cgit