mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
test: use vim.inspect directly
This commit is contained in:
parent
7a259d01ae
commit
56a2ec5c79
@ -730,17 +730,16 @@ function module.expect_any(contents)
|
||||
end
|
||||
|
||||
function module.expect_events(expected, received, kind)
|
||||
local inspect = require 'vim.inspect'
|
||||
if not pcall(eq, expected, received) then
|
||||
local msg = 'unexpected ' .. kind .. ' received.\n\n'
|
||||
|
||||
msg = msg .. 'received events:\n'
|
||||
for _, e in ipairs(received) do
|
||||
msg = msg .. ' ' .. inspect(e) .. ';\n'
|
||||
msg = msg .. ' ' .. vim.inspect(e) .. ';\n'
|
||||
end
|
||||
msg = msg .. '\nexpected events:\n'
|
||||
for _, e in ipairs(expected) do
|
||||
msg = msg .. ' ' .. inspect(e) .. ';\n'
|
||||
msg = msg .. ' ' .. vim.inspect(e) .. ';\n'
|
||||
end
|
||||
fail(msg)
|
||||
end
|
||||
|
@ -5,7 +5,6 @@ local exec_lua = helpers.exec_lua
|
||||
local clear = helpers.clear
|
||||
local feed = helpers.feed
|
||||
local funcs = helpers.funcs
|
||||
local inspect = require 'vim.inspect'
|
||||
|
||||
describe('vim.ui_attach', function()
|
||||
local screen
|
||||
@ -38,7 +37,7 @@ describe('vim.ui_attach', function()
|
||||
|
||||
local function expect_events(expected)
|
||||
local evs = exec_lua 'return get_events(...)'
|
||||
eq(expected, evs, inspect(evs))
|
||||
eq(expected, evs, vim.inspect(evs))
|
||||
end
|
||||
|
||||
it('can receive popupmenu events', function()
|
||||
@ -148,6 +147,6 @@ describe('vim.ui_attach', function()
|
||||
{ 'echomsg', { { 0, 'message3' } } },
|
||||
},
|
||||
},
|
||||
}, actual, inspect(actual))
|
||||
}, actual, vim.inspect(actual))
|
||||
end)
|
||||
end)
|
||||
|
@ -82,7 +82,7 @@ local dedent = helpers.dedent
|
||||
local get_session = helpers.get_session
|
||||
local create_callindex = helpers.create_callindex
|
||||
|
||||
local inspect = require('vim.inspect')
|
||||
local inspect = vim.inspect
|
||||
|
||||
local function isempty(v)
|
||||
return type(v) == 'table' and next(v) == nil
|
||||
|
Loading…
Reference in New Issue
Block a user