annotate src/testdir/test_arglist.vim @ 11680:c66d6dc92f53 v8.0.0723

patch 8.0.0723: arglist test fails if file name case is ignored commit https://github.com/vim/vim/commit/9b50bba643f8d1fcac91e11780da7d03d8995260 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 16 16:42:13 2017 +0200 patch 8.0.0723: arglist test fails if file name case is ignored Problem: Arglist test fails if file name case is ignored. Solution: Wipe existing buffers, check for fname_case property.
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Jul 2017 16:45:03 +0200
parents f87c43fca41d
children 976b480ced9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7639
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Test argument list commands
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 func Test_argidx()
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 args a b c
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 last
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 call assert_equal(2, argidx())
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 %argdelete
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call assert_equal(0, argidx())
11103
3335c3c75611 patch 8.0.0439: ":%argdel" gives an error for an empty arglist
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
9 " doing it again doesn't result in an error
3335c3c75611 patch 8.0.0439: ":%argdel" gives an error for an empty arglist
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
10 %argdelete
3335c3c75611 patch 8.0.0439: ":%argdel" gives an error for an empty arglist
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
11 call assert_equal(0, argidx())
3335c3c75611 patch 8.0.0439: ":%argdel" gives an error for an empty arglist
Christian Brabandt <cb@256bit.org>
parents: 10145
diff changeset
12 call assert_fails('2argdelete', 'E16:')
7639
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 args a b c
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 call assert_equal(0, argidx())
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 next
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call assert_equal(1, argidx())
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 next
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call assert_equal(2, argidx())
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 1argdelete
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call assert_equal(1, argidx())
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 1argdelete
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 call assert_equal(0, argidx())
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 1argdelete
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call assert_equal(0, argidx())
0ecb62a66a7a commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 endfunc
7647
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
27
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
28 func Test_argadd()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
29 %argdelete
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
30 argadd a b c
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
31 call assert_equal(0, argidx())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
32
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
33 %argdelete
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
34 argadd a
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
35 call assert_equal(0, argidx())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
36 argadd b c d
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
37 call assert_equal(0, argidx())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
38
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
39 call Init_abc()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
40 argadd x
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
41 call Assert_argc(['a', 'b', 'x', 'c'])
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
42 call assert_equal(1, argidx())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
43
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
44 call Init_abc()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
45 0argadd x
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
46 call Assert_argc(['x', 'a', 'b', 'c'])
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
47 call assert_equal(2, argidx())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
48
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
49 call Init_abc()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
50 1argadd x
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
51 call Assert_argc(['a', 'x', 'b', 'c'])
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
52 call assert_equal(2, argidx())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
53
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
54 call Init_abc()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
55 $argadd x
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
56 call Assert_argc(['a', 'b', 'c', 'x'])
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
57 call assert_equal(1, argidx())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
58
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
59 call Init_abc()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
60 $argadd x
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
61 +2argadd y
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
62 call Assert_argc(['a', 'b', 'c', 'x', 'y'])
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
63 call assert_equal(1, argidx())
7726
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
64
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
65 %argd
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
66 edit d
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
67 arga
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
68 call assert_equal(len(argv()), 1)
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
69 call assert_equal(get(argv(), 0, ''), 'd')
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
70
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
71 %argd
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
72 new
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
73 arga
f6311c321411 commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents: 7672
diff changeset
74 call assert_equal(len(argv()), 0)
7647
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
75 endfunc
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
76
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
77 func Init_abc()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
78 args a b c
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
79 next
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
80 endfunc
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
81
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
82 func Assert_argc(l)
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
83 call assert_equal(len(a:l), argc())
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
84 let i = 0
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
85 while i < len(a:l) && i < argc()
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
86 call assert_equal(a:l[i], argv(i))
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
87 let i += 1
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
88 endwhile
65b2d593c203 commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents: 7639
diff changeset
89 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
90
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
91 " Test for [count]argument and [count]argdelete commands
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
92 " Ported from the test_argument_count.in test script
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
93 func Test_argument()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
94 " Clean the argument list
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
95 arga a | %argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
96
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
97 let save_hidden = &hidden
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
98 set hidden
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
99
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
100 let g:buffers = []
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
101 augroup TEST
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
102 au BufEnter * call add(buffers, expand('%:t'))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
103 augroup END
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
104
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
105 argadd a b c d
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
106 $argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
107 $-argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
108 -argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
109 1argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
110 +2argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
111
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
112 augroup TEST
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
113 au!
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
114 augroup END
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
115
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
116 call assert_equal(['d', 'c', 'b', 'a', 'c'], g:buffers)
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
117
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
118 redir => result
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
119 ar
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
120 redir END
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
121 call assert_true(result =~# 'a b \[c] d')
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
122
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
123 .argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
124 call assert_equal(['a', 'b', 'd'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
125
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
126 -argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
127 call assert_equal(['a', 'd'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
128
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
129 $argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
130 call assert_equal(['a'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
131
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
132 1arga c
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
133 1arga b
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
134 $argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
135 $arga x
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
136 call assert_equal(['a', 'b', 'c', 'x'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
137
7672
da2eb24b83d2 commit https://github.com/vim/vim/commit/301417041bdb15264a9c8ff20e4fea4dcc12c478
Christian Brabandt <cb@256bit.org>
parents: 7670
diff changeset
138 0arga y
da2eb24b83d2 commit https://github.com/vim/vim/commit/301417041bdb15264a9c8ff20e4fea4dcc12c478
Christian Brabandt <cb@256bit.org>
parents: 7670
diff changeset
139 call assert_equal(['y', 'a', 'b', 'c', 'x'], argv())
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
140
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
141 %argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
142 call assert_equal([], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
143
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
144 arga a b c d e f
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
145 2,$-argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
146 call assert_equal(['a', 'f'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
147
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
148 let &hidden = save_hidden
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
149
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
150 " Setting argument list should fail when the current buffer has unsaved
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
151 " changes
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
152 %argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
153 enew!
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
154 set modified
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
155 call assert_fails('args x y z', 'E37:')
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
156 args! x y z
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
157 call assert_equal(['x', 'y', 'z'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
158 call assert_equal('x', expand('%:t'))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
159
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
160 last | enew | argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
161 call assert_equal('z', expand('%:t'))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
162
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
163 %argdelete
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
164 call assert_fails('argument', 'E163:')
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
165 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
166
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
167 " Test for 0argadd and 0argedit
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
168 " Ported from the test_argument_0count.in test script
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
169 func Test_zero_argadd()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
170 " Clean the argument list
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
171 arga a | %argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
172
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
173 arga a b c d
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
174 2argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
175 0arga added
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
176 call assert_equal(['added', 'a', 'b', 'c', 'd'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
177
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
178 2argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
179 arga third
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
180 call assert_equal(['added', 'a', 'third', 'b', 'c', 'd'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
181
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
182 %argd
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
183 arga a b c d
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
184 2argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
185 0arge edited
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
186 call assert_equal(['edited', 'a', 'b', 'c', 'd'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
187
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
188 2argu
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
189 arga third
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
190 call assert_equal(['edited', 'a', 'third', 'b', 'c', 'd'], argv())
11676
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
191
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
192 2argu
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
193 argedit file\ with\ spaces another file
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
194 call assert_equal(['edited', 'a', 'file with spaces', 'another', 'file', 'third', 'b', 'c', 'd'], argv())
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
195 call assert_equal('file with spaces', expand('%'))
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
196 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
197
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
198 func Reset_arglist()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
199 args a | %argd
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
200 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
201
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
202 " Test for argc()
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
203 func Test_argc()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
204 call Reset_arglist()
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
205 call assert_equal(0, argc())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
206 argadd a b
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
207 call assert_equal(2, argc())
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
208 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
209
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
210 " Test for arglistid()
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
211 func Test_arglistid()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
212 call Reset_arglist()
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
213 arga a b
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
214 call assert_equal(0, arglistid())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
215 split
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
216 arglocal
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
217 call assert_equal(1, arglistid())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
218 tabnew | tabfirst
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
219 call assert_equal(0, arglistid(2))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
220 call assert_equal(1, arglistid(1, 1))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
221 call assert_equal(0, arglistid(2, 1))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
222 call assert_equal(1, arglistid(1, 2))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
223 tabonly | only | enew!
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
224 argglobal
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
225 call assert_equal(0, arglistid())
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
226 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
227
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
228 " Test for argv()
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
229 func Test_argv()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
230 call Reset_arglist()
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
231 call assert_equal([], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
232 call assert_equal("", argv(2))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
233 argadd a b c d
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
234 call assert_equal('c', argv(2))
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
235 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
236
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
237 " Test for the :argedit command
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
238 func Test_argedit()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
239 call Reset_arglist()
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
240 argedit a
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
241 call assert_equal(['a'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
242 call assert_equal('a', expand('%:t'))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
243 argedit b
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
244 call assert_equal(['a', 'b'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
245 call assert_equal('b', expand('%:t'))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
246 argedit a
11676
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
247 call assert_equal(['a', 'b', 'a'], argv())
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
248 call assert_equal('a', expand('%:t'))
11680
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
249 " When file name case is ignored, an existing buffer with only case
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
250 " difference is re-used. Make sure they don't exist so the case is
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
251 " preserved.
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
252 bwipe! c
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
253 bwipe! d
11676
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
254 argedit C D
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
255 call assert_equal('C', expand('%:t'))
f87c43fca41d patch 8.0.0721: :argedit can only have one argument
Christian Brabandt <cb@256bit.org>
parents: 11173
diff changeset
256 call assert_equal(['a', 'b', 'a', 'C', 'D'], argv())
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
257 argedit c
11680
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
258 if has('fname_case')
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
259 call assert_equal(['a', 'b', 'a', 'C', 'c', 'D'], argv())
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
260 else
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
261 call assert_equal(['a', 'b', 'a', 'C', 'C', 'D'], argv())
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
262 endif
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
263 0argedit x
11680
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
264 if has('fname_case')
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
265 call assert_equal(['x', 'a', 'b', 'a', 'C', 'c', 'D'], argv())
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
266 else
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
267 call assert_equal(['x', 'a', 'b', 'a', 'C', 'C', 'D'], argv())
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
268 endif
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
269 enew! | set modified
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
270 call assert_fails('argedit y', 'E37:')
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
271 argedit! y
11680
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
272 if has('fname_case')
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
273 call assert_equal(['x', 'y', 'y', 'a', 'b', 'a', 'C', 'c', 'D'], argv())
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
274 else
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
275 call assert_equal(['x', 'y', 'y', 'a', 'b', 'a', 'C', 'C', 'D'], argv())
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
276 endif
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
277 %argd
11680
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
278 bwipe! C
c66d6dc92f53 patch 8.0.0723: arglist test fails if file name case is ignored
Christian Brabandt <cb@256bit.org>
parents: 11676
diff changeset
279 bwipe! D
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
280 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
281
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
282 " Test for the :argdelete command
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
283 func Test_argdelete()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
284 call Reset_arglist()
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
285 args aa a aaa b bb
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
286 argdelete a*
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
287 call assert_equal(['b', 'bb'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
288 call assert_equal('aa', expand('%:t'))
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
289 last
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
290 argdelete %
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
291 call assert_equal(['b'], argv())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
292 call assert_fails('argdelete', 'E471:')
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
293 call assert_fails('1,100argdelete', 'E16:')
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
294 %argd
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
295 endfunc
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
296
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
297 " Tests for the :next, :prev, :first, :last, :rewind commands
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
298 func Test_argpos()
7666
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
299 call Reset_arglist()
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
300 args a b c d
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
301 last
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
302 call assert_equal(3, argidx())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
303 call assert_fails('next', 'E165:')
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
304 prev
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
305 call assert_equal(2, argidx())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
306 Next
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
307 call assert_equal(1, argidx())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
308 first
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
309 call assert_equal(0, argidx())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
310 call assert_fails('prev', 'E164:')
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
311 3next
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
312 call assert_equal(3, argidx())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
313 rewind
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
314 call assert_equal(0, argidx())
8edd1afaf6b7 commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents: 7647
diff changeset
315 %argd
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
316 endfunc
10145
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
317
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
318 " Test for autocommand that redefines the argument list, when doing ":all".
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
319 func Test_arglist_autocmd()
10145
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
320 autocmd BufReadPost Xxx2 next Xxx2 Xxx1
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
321 call writefile(['test file Xxx1'], 'Xxx1')
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
322 call writefile(['test file Xxx2'], 'Xxx2')
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
323 call writefile(['test file Xxx3'], 'Xxx3')
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
324
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
325 new
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
326 " redefine arglist; go to Xxx1
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
327 next! Xxx1 Xxx2 Xxx3
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
328 " open window for all args
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
329 all
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
330 call assert_equal('test file Xxx1', getline(1))
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
331 wincmd w
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
332 wincmd w
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
333 call assert_equal('test file Xxx1', getline(1))
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
334 " should now be in Xxx2
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
335 rewind
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
336 call assert_equal('test file Xxx2', getline(1))
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
337
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
338 autocmd! BufReadPost Xxx2
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
339 enew! | only
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
340 call delete('Xxx1')
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
341 call delete('Xxx2')
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
342 call delete('Xxx3')
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
343 argdelete Xxx*
eb9a7296ae9f commit https://github.com/vim/vim/commit/53f1673cd909eb1c809c6a9086e3d104a0df9bed
Christian Brabandt <cb@256bit.org>
parents: 7726
diff changeset
344 bwipe! Xxx1 Xxx2 Xxx3
11173
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
345 endfunc
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
346
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
347 func Test_arg_all_expand()
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
348 call writefile(['test file Xxx1'], 'Xx x')
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
349 next notexist Xx\ x runtest.vim
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
350 call assert_equal('notexist Xx\ x runtest.vim', expand('##'))
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
351 call delete('Xx x')
cc94b80016fd patch 8.0.0473: no test covering arg_all()
Christian Brabandt <cb@256bit.org>
parents: 11103
diff changeset
352 endfunc