mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
052498ed42
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.
26 lines
684 B
Lua
26 lines
684 B
Lua
local t = require('test.testutil')
|
|
local n = require('test.functional.testnvim')()
|
|
|
|
local eq = t.eq
|
|
local eval = n.eval
|
|
local api = n.api
|
|
local clear = n.clear
|
|
|
|
before_each(clear)
|
|
|
|
describe('extend()', function()
|
|
it('succeeds to extend list with itself', function()
|
|
api.nvim_set_var('l', { 1, {} })
|
|
eq({ 1, {}, 1, {} }, eval('extend(l, l)'))
|
|
eq({ 1, {}, 1, {} }, api.nvim_get_var('l'))
|
|
|
|
api.nvim_set_var('l', { 1, {} })
|
|
eq({ 1, {}, 1, {} }, eval('extend(l, l, 0)'))
|
|
eq({ 1, {}, 1, {} }, api.nvim_get_var('l'))
|
|
|
|
api.nvim_set_var('l', { 1, {} })
|
|
eq({ 1, 1, {}, {} }, eval('extend(l, l, 1)'))
|
|
eq({ 1, 1, {}, {} }, api.nvim_get_var('l'))
|
|
end)
|
|
end)
|