2024-04-09 06:26:16 -05:00
|
|
|
local t = require('test.functional.testutil')()
|
2024-04-08 04:03:20 -05:00
|
|
|
local eq, command, fn = t.eq, t.command, t.fn
|
|
|
|
local ok = t.ok
|
|
|
|
local matches = t.matches
|
|
|
|
local clear = t.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-08 04:03:20 -05:00
|
|
|
t.feed([[<C-\><C-N>]])
|
2017-04-08 16:12:26 -05:00
|
|
|
command('argadd')
|
2024-04-08 04:03:20 -05:00
|
|
|
t.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-08 04:03:20 -05:00
|
|
|
t.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-08 04:03:20 -05:00
|
|
|
eq('[' .. bufname_before .. ']', t.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)
|