mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -14,7 +14,6 @@ local check_cores = global_helpers.check_cores | |||||||
| local check_logs = global_helpers.check_logs | local check_logs = global_helpers.check_logs | ||||||
| local neq = global_helpers.neq | local neq = global_helpers.neq | ||||||
| local eq = global_helpers.eq | local eq = global_helpers.eq | ||||||
| local eq_any = global_helpers.eq_any |  | ||||||
| local ok = global_helpers.ok | local ok = global_helpers.ok | ||||||
| local map = global_helpers.map | local map = global_helpers.map | ||||||
| local filter = global_helpers.filter | local filter = global_helpers.filter | ||||||
| @@ -733,7 +732,6 @@ local module = { | |||||||
|   curwinmeths = curwinmeths, |   curwinmeths = curwinmeths, | ||||||
|   dedent = dedent, |   dedent = dedent, | ||||||
|   eq = eq, |   eq = eq, | ||||||
|   eq_any = eq_any, |  | ||||||
|   eval = nvim_eval, |   eval = nvim_eval, | ||||||
|   exc_exec = exc_exec, |   exc_exec = exc_exec, | ||||||
|   expect = expect, |   expect = expect, | ||||||
|   | |||||||
| @@ -10,28 +10,8 @@ local check_logs_useless_lines = { | |||||||
| local function eq(expected, actual) | local function eq(expected, actual) | ||||||
|   return assert.are.same(expected, actual) |   return assert.are.same(expected, actual) | ||||||
| end | end | ||||||
| -- Tries multiple accepted ("expected") values until one succeeds. | local function neq(expected, actual) | ||||||
| -- First N-1 arguments are the accepted values. |   return assert.are_not.same(expected, actual) | ||||||
| -- 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) |  | ||||||
| end | end | ||||||
| local function ok(res) | local function ok(res) | ||||||
|   return assert.is_true(res) |   return assert.is_true(res) | ||||||
| @@ -581,7 +561,6 @@ return { | |||||||
|   deepcopy = deepcopy, |   deepcopy = deepcopy, | ||||||
|   dictdiff = dictdiff, |   dictdiff = dictdiff, | ||||||
|   eq = eq, |   eq = eq, | ||||||
|   eq_any = eq_any, |  | ||||||
|   filter = filter, |   filter = filter, | ||||||
|   fixtbl = fixtbl, |   fixtbl = fixtbl, | ||||||
|   fixtbl_rec = fixtbl_rec, |   fixtbl_rec = fixtbl_rec, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Justin M. Keyes
					Justin M. Keyes