2024-04-20 10:44:13 -05:00
|
|
|
local t = require('test.testutil')
|
|
|
|
local n = require('test.functional.testnvim')()
|
|
|
|
|
|
|
|
local eq, command, fn = t.eq, n.command, n.fn
|
2024-04-08 04:03:20 -05:00
|
|
|
local ok = t.ok
|
|
|
|
local matches = t.matches
|
2024-04-20 10:44:13 -05:00
|
|
|
local clear = n.clear
|
2016-10-09 09:00:12 -05:00
|
|
|
|
|
|
|
describe(':argument', function()
|
2016-11-16 17:33:45 -06:00
|
|
|
before_each(function()
|
2016-10-09 09:00:12 -05:00
|
|
|
clear()
|
|
|
|
end)
|
|
|
|
|
|
|
|
it('does not restart :terminal buffer', function()
|
2017-04-08 16:12:26 -05:00
|
|
|
command('terminal')
|
2024-04-20 10:44:13 -05:00
|
|
|
n.feed([[<C-\><C-N>]])
|
2017-04-08 16:12:26 -05:00
|
|
|
command('argadd')
|
2024-04-20 10:44:13 -05:00
|
|
|
n.feed([[<C-\><C-N>]])
|
2024-01-12 11:59:57 -06:00
|
|
|
local bufname_before = fn.bufname('%')
|
|
|
|
local bufnr_before = fn.bufnr('%')
|
2024-03-29 20:29:21 -05:00
|
|
|
matches('^term://', bufname_before) -- sanity
|
2016-10-09 09:00:12 -05:00
|
|
|
|
2017-04-08 16:12:26 -05:00
|
|
|
command('argument 1')
|
2024-04-20 10:44:13 -05:00
|
|
|
n.feed([[<C-\><C-N>]])
|
2016-10-09 09:00:12 -05:00
|
|
|
|
2024-01-12 11:59:57 -06:00
|
|
|
local bufname_after = fn.bufname('%')
|
|
|
|
local bufnr_after = fn.bufnr('%')
|
2024-04-20 10:44:13 -05:00
|
|
|
eq('[' .. bufname_before .. ']', n.eval('trim(execute("args"))'))
|
2024-01-12 11:59:57 -06:00
|
|
|
ok(fn.line('$') > 1)
|
2016-10-09 09:00:12 -05:00
|
|
|
eq(bufname_before, bufname_after)
|
|
|
|
eq(bufnr_before, bufnr_after)
|
|
|
|
end)
|
|
|
|
end)
|