mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
tests: Add helpers.write_file() to write short files.
This commit is contained in:
parent
bfadf5a28b
commit
f0850775bf
@ -207,6 +207,14 @@ local function execute(...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Dedent the given text and write it to the file name.
|
||||||
|
local function write_file(name, text)
|
||||||
|
local file = io.open(name, 'w')
|
||||||
|
file:write(dedent(text))
|
||||||
|
file:flush()
|
||||||
|
file:close()
|
||||||
|
end
|
||||||
|
|
||||||
local function source(code)
|
local function source(code)
|
||||||
local tmpname = os.tmpname()
|
local tmpname = os.tmpname()
|
||||||
local tmpfile = io.open(tmpname, "w")
|
local tmpfile = io.open(tmpname, "w")
|
||||||
@ -315,5 +323,6 @@ return {
|
|||||||
curtab = curtab,
|
curtab = curtab,
|
||||||
curbuf_contents = curbuf_contents,
|
curbuf_contents = curbuf_contents,
|
||||||
wait = wait,
|
wait = wait,
|
||||||
set_session = set_session
|
set_session = set_session,
|
||||||
|
write_file = write_file
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user