mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
legacy tests: implement :source helper method.
This commit is contained in:
parent
1732615290
commit
e0332e7f7c
@ -182,6 +182,16 @@ local function execute(...)
|
||||
end
|
||||
end
|
||||
|
||||
local function source(code)
|
||||
local tmpname = os.tmpname()
|
||||
local tmpfile = io.open(tmpname, "w")
|
||||
tmpfile:write(code)
|
||||
tmpfile:flush()
|
||||
tmpfile:close()
|
||||
nvim_command('source '..tmpname)
|
||||
os.remove(tmpname)
|
||||
end
|
||||
|
||||
local function eq(expected, actual)
|
||||
return assert.are.same(expected, actual)
|
||||
end
|
||||
@ -247,6 +257,7 @@ clear()
|
||||
return {
|
||||
clear = clear,
|
||||
dedent = dedent,
|
||||
source = source,
|
||||
rawfeed = rawfeed,
|
||||
insert = insert,
|
||||
feed = feed,
|
||||
|
Loading…
Reference in New Issue
Block a user