aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/argument_0count_spec.lua
blob: d27809c8d856fac1faf720bb166ee4bc4a5bfd47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- Tests for :0argadd and :0argedit

local helpers = require('test.functional.helpers')
local source, clear, expect = helpers.source, helpers.clear, helpers.expect

describe('argument_0count', function()
  setup(clear)

  it('is working', function()
    source([[
      let arglists = []
      arga a b c d
      2argu
      0arga added
      call add(arglists, argv())
      2argu
      arga third
      call add(arglists, argv())
      %argd
      arga a b c d
      2argu
      0arge edited
      call add(arglists, argv())
      2argu
      arga third
      call add(arglists, argv())
      call append(0, map(copy(arglists), 'join(v:val, " ")'))
    ]])

    -- Assert buffer contents.
    expect([=[
      added a b c d
      added a third b c d
      edited a b c d
      edited a third b c d
      ]=])
  end)
end)