mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
test: improve test conventions
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
local t = require('test.functional.testutil')()
|
||||
local nvim, call = t.api, t.call
|
||||
local clear, eq = t.clear, t.eq
|
||||
local source, command = t.source, t.command
|
||||
local exc_exec = t.exc_exec
|
||||
local eval = t.eval
|
||||
local t = require('test.testutil')
|
||||
local n = require('test.functional.testnvim')()
|
||||
|
||||
local api, call = n.api, n.call
|
||||
local clear, eq = n.clear, t.eq
|
||||
local source, command = n.source, n.command
|
||||
local exc_exec = n.exc_exec
|
||||
local eval = n.eval
|
||||
|
||||
local function expected_errors(errors)
|
||||
eq(errors, nvim.nvim_get_vvar('errors'))
|
||||
eq(errors, api.nvim_get_vvar('errors'))
|
||||
end
|
||||
|
||||
local function expected_empty()
|
||||
eq({}, nvim.nvim_get_vvar('errors'))
|
||||
eq({}, api.nvim_get_vvar('errors'))
|
||||
end
|
||||
|
||||
describe('assert function:', function()
|
||||
|
||||
Reference in New Issue
Block a user