Mercurial > vim
annotate src/testdir/test_arglist.vim @ 8222:4f0677020a43 v7.4.1404
commit https://github.com/vim/vim/commit/9186a276222ea8a7c88f4092ac5b4201381f4e20
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 23 19:34:01 2016 +0100
patch 7.4.1404
Problem: ch_read() doesn't time out on MS-Windows.
Solution: Instead of WM_NETBEANS use select(). (Yukihiro Nakadaira)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 23 Feb 2016 19:45:05 +0100 |
parents | f6311c321411 |
children | eb9a7296ae9f |
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()) |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 args a b c |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call assert_equal(0, argidx()) |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 next |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal(1, argidx()) |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 next |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal(2, argidx()) |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 1argdelete |
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 1argdelete |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal(0, 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(0, argidx()) |
0ecb62a66a7a
commit https://github.com/vim/vim/commit/72defda84eb26be9e2ade56c7877b912f818026e
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 endfunc |
7647
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
23 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
24 func Test_argadd() |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
25 %argdelete |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
26 argadd a b c |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
27 call assert_equal(0, argidx()) |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
28 |
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 |
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 argadd b c d |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
33 call assert_equal(0, argidx()) |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
34 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
35 call Init_abc() |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
36 argadd x |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
37 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
|
38 call assert_equal(1, argidx()) |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
39 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
40 call Init_abc() |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
41 0argadd x |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
42 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
|
43 call assert_equal(2, argidx()) |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
44 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
45 call Init_abc() |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
46 1argadd x |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
47 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
|
48 call assert_equal(2, argidx()) |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
49 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
50 call Init_abc() |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
51 $argadd x |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
52 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
|
53 call assert_equal(1, argidx()) |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
54 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
55 call Init_abc() |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
56 $argadd x |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
57 +2argadd y |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
58 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
|
59 call assert_equal(1, argidx()) |
7726
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
60 |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
61 %argd |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
62 edit d |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
63 arga |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
64 call assert_equal(len(argv()), 1) |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
65 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
|
66 |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
67 %argd |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
68 new |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
69 arga |
f6311c321411
commit https://github.com/vim/vim/commit/2faa29f896252073b53f387406109e331fbbe5f8
Christian Brabandt <cb@256bit.org>
parents:
7672
diff
changeset
|
70 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
|
71 endfunc |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
72 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
73 func Init_abc() |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
74 args a b c |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
75 next |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
76 endfunc |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
77 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
78 func Assert_argc(l) |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
79 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
|
80 let i = 0 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
81 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
|
82 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
|
83 let i += 1 |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
84 endwhile |
65b2d593c203
commit https://github.com/vim/vim/commit/a24f0a550fed3d9773800cf6be4efd072fff20ec
Christian Brabandt <cb@256bit.org>
parents:
7639
diff
changeset
|
85 endfunc |
7666
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
86 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
87 " 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
|
88 " Ported from the test_argument_count.in test script |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
89 function Test_argument() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
90 " Clean the argument list |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
91 arga a | %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
92 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
93 let save_hidden = &hidden |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
94 set hidden |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
95 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
96 let g:buffers = [] |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
97 augroup TEST |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
98 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
|
99 augroup END |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
100 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
101 argadd a b c d |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
102 $argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
103 $-argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
104 -argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
105 1argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
106 +2argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
107 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
108 augroup TEST |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
109 au! |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
110 augroup END |
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 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
|
113 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
114 redir => result |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
115 ar |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
116 redir END |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
117 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
|
118 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
119 .argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
120 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
|
121 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
122 -argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
123 call assert_equal(['a', 'd'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
124 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
125 $argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
126 call assert_equal(['a'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
127 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
128 1arga c |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
129 1arga b |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
130 $argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
131 $arga x |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
132 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
|
133 |
7672
da2eb24b83d2
commit https://github.com/vim/vim/commit/301417041bdb15264a9c8ff20e4fea4dcc12c478
Christian Brabandt <cb@256bit.org>
parents:
7670
diff
changeset
|
134 0arga y |
da2eb24b83d2
commit https://github.com/vim/vim/commit/301417041bdb15264a9c8ff20e4fea4dcc12c478
Christian Brabandt <cb@256bit.org>
parents:
7670
diff
changeset
|
135 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
|
136 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
137 %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
138 call assert_equal([], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
139 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
140 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
|
141 2,$-argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
142 call assert_equal(['a', 'f'], 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 let &hidden = save_hidden |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
145 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
146 " 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
|
147 " changes |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
148 %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
149 enew! |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
150 set modified |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
151 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
|
152 args! x y z |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
153 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
|
154 call assert_equal('x', expand('%:t')) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
155 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
156 last | enew | argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
157 call assert_equal('z', expand('%:t')) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
158 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
159 %argdelete |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
160 call assert_fails('argument', 'E163:') |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
161 endfunction |
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 " Test for 0argadd and 0argedit |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
164 " Ported from the test_argument_0count.in test script |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
165 function Test_zero_argadd() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
166 " Clean the argument list |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
167 arga a | %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
168 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
169 arga a b c d |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
170 2argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
171 0arga added |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
172 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
|
173 |
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 arga third |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
176 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
|
177 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
178 %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
179 arga a b c d |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
180 2argu |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
181 0arge edited |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
182 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
|
183 |
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 arga third |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
186 call assert_equal(['edited', 'a', 'third', 'b', 'c', 'd'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
187 endfunction |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
188 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
189 function Reset_arglist() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
190 args a | %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
191 endfunction |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
192 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
193 " Test for argc() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
194 function Test_argc() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
195 call Reset_arglist() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
196 call assert_equal(0, argc()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
197 argadd a b |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
198 call assert_equal(2, argc()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
199 endfunction |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
200 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
201 " Test for arglistid() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
202 function Test_arglistid() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
203 call Reset_arglist() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
204 arga a b |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
205 call assert_equal(0, arglistid()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
206 split |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
207 arglocal |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
208 call assert_equal(1, arglistid()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
209 tabnew | tabfirst |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
210 call assert_equal(0, arglistid(2)) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
211 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
|
212 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
|
213 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
|
214 tabonly | only | enew! |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
215 argglobal |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
216 call assert_equal(0, arglistid()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
217 endfunction |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
218 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
219 " Test for argv() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
220 function Test_argv() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
221 call Reset_arglist() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
222 call assert_equal([], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
223 call assert_equal("", argv(2)) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
224 argadd a b c d |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
225 call assert_equal('c', argv(2)) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
226 endfunction |
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 the :argedit command |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
229 function Test_argedit() |
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 argedit a |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
232 call assert_equal(['a'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
233 call assert_equal('a', expand('%:t')) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
234 argedit b |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
235 call assert_equal(['a', 'b'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
236 call assert_equal('b', expand('%:t')) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
237 argedit a |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
238 call assert_equal(['a', 'b'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
239 call assert_equal('a', expand('%:t')) |
7670
fd31843c7b58
commit https://github.com/vim/vim/commit/82e4184d489e2ce950c871354062fca40bf59598
Christian Brabandt <cb@256bit.org>
parents:
7666
diff
changeset
|
240 if has('unix') |
fd31843c7b58
commit https://github.com/vim/vim/commit/82e4184d489e2ce950c871354062fca40bf59598
Christian Brabandt <cb@256bit.org>
parents:
7666
diff
changeset
|
241 " on MS-Windows this would edit file "a b" |
fd31843c7b58
commit https://github.com/vim/vim/commit/82e4184d489e2ce950c871354062fca40bf59598
Christian Brabandt <cb@256bit.org>
parents:
7666
diff
changeset
|
242 call assert_fails('argedit a b', 'E172:') |
fd31843c7b58
commit https://github.com/vim/vim/commit/82e4184d489e2ce950c871354062fca40bf59598
Christian Brabandt <cb@256bit.org>
parents:
7666
diff
changeset
|
243 endif |
7666
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
244 argedit c |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
245 call assert_equal(['a', 'c', 'b'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
246 0argedit x |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
247 call assert_equal(['x', 'a', 'c', 'b'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
248 enew! | set modified |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
249 call assert_fails('argedit y', 'E37:') |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
250 argedit! y |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
251 call assert_equal(['x', 'y', 'a', 'c', 'b'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
252 %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
253 endfunction |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
254 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
255 " Test for the :argdelete command |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
256 function Test_argdelete() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
257 call Reset_arglist() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
258 args aa a aaa b bb |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
259 argdelete a* |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
260 call assert_equal(['b', 'bb'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
261 call assert_equal('aa', expand('%:t')) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
262 last |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
263 argdelete % |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
264 call assert_equal(['b'], argv()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
265 call assert_fails('argdelete', 'E471:') |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
266 call assert_fails('1,100argdelete', 'E16:') |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
267 %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
268 endfunction |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
269 |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
270 " Tests for the :next, :prev, :first, :last, :rewind commands |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
271 function Test_argpos() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
272 call Reset_arglist() |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
273 args a b c d |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
274 last |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
275 call assert_equal(3, argidx()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
276 call assert_fails('next', 'E165:') |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
277 prev |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
278 call assert_equal(2, argidx()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
279 Next |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
280 call assert_equal(1, argidx()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
281 first |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
282 call assert_equal(0, argidx()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
283 call assert_fails('prev', 'E164:') |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
284 3next |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
285 call assert_equal(3, argidx()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
286 rewind |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
287 call assert_equal(0, argidx()) |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
288 %argd |
8edd1afaf6b7
commit https://github.com/vim/vim/commit/99dbe291f55022bd5166c9c3c7967b8693cd9d1b
Christian Brabandt <cb@256bit.org>
parents:
7647
diff
changeset
|
289 endfunction |