2016-10-09 07:00:12 -07:00
|
|
|
local helpers = require("test.functional.helpers")(after_each)
|
2017-04-08 14:12:26 -07:00
|
|
|
local eq, command, funcs = helpers.eq, helpers.command, helpers.funcs
|
2016-10-09 07:00:12 -07:00
|
|
|
local ok = helpers.ok
|
|
|
|
local clear = helpers.clear
|
2017-04-08 14:12:26 -07:00
|
|
|
local feed = helpers.feed
|
2016-10-09 07:00:12 -07:00
|
|
|
|
|
|
|
describe(":edit", function()
|
2016-11-16 16:33:45 -07:00
|
|
|
before_each(function()
|
2016-10-09 07:00:12 -07:00
|
|
|
clear()
|
|
|
|
end)
|
|
|
|
|
|
|
|
it("without arguments does not restart :terminal buffer", function()
|
2017-04-08 14:12:26 -07:00
|
|
|
command("terminal")
|
|
|
|
feed([[<C-\><C-N>]])
|
2016-10-09 07:00:12 -07:00
|
|
|
local bufname_before = funcs.bufname("%")
|
|
|
|
local bufnr_before = funcs.bufnr("%")
|
|
|
|
helpers.ok(nil ~= string.find(bufname_before, "^term://")) -- sanity
|
|
|
|
|
2017-04-08 14:12:26 -07:00
|
|
|
command("edit")
|
2016-10-09 07:00:12 -07:00
|
|
|
|
|
|
|
local bufname_after = funcs.bufname("%")
|
|
|
|
local bufnr_after = funcs.bufnr("%")
|
|
|
|
ok(funcs.line('$') > 1)
|
|
|
|
eq(bufname_before, bufname_after)
|
|
|
|
eq(bufnr_before, bufnr_after)
|
|
|
|
end)
|
|
|
|
end)
|