robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
938 B34 linesraw
1local t = require('test.testutil')
2local n = require('test.functional.testnvim')()
3
4local describe, it, before_each = t.describe, t.it, t.before_each
5local eq, command, fn = t.eq, n.command, n.fn
6local ok = t.ok
7local matches = t.matches
8local clear = n.clear
9
10describe(':argument', function()
11  before_each(function()
12    clear()
13  end)
14
15  it('does not restart :terminal buffer', function()
16    command('terminal')
17    n.feed([[<C-\><C-N>]])
18    command('argadd')
19    n.feed([[<C-\><C-N>]])
20    local bufname_before = fn.bufname('%')
21    local bufnr_before = fn.bufnr('%')
22    matches('^term://', bufname_before) -- sanity
23
24    command('argument 1')
25    n.feed([[<C-\><C-N>]])
26
27    local bufname_after = fn.bufname('%')
28    local bufnr_after = fn.bufnr('%')
29    eq('[' .. bufname_before .. ']', n.eval('trim(execute("args"))'))
30    ok(fn.line('$') > 1)
31    eq(bufname_before, bufname_after)
32    eq(bufnr_before, bufnr_after)
33  end)
34end)