annotate src/testdir/test_wnext.vim @ 18954:f9bd54e7f8ee

Added tag v8.2.0037 for changeset 30c965c6f85578a2d956de22970ff781b4239946
author Bram Moolenaar <Bram@vim.org>
date Tue, 24 Dec 2019 15:45:04 +0100
parents de068e9acd8e
children 08940efa6b4e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15838
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Test :wnext :wNext and :wprevious
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 func Test_wnext()
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 args X1 X2
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 call setline(1, '1')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 wnext
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 call assert_equal(['1'], readfile('X1'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 call assert_equal('X2', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 call setline(1, '2')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 call assert_fails('wnext', 'E165:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 call assert_equal(['2'], readfile('X2'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 call assert_equal('X2', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 " Test :wnext with a single file.
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 args X1
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 call assert_equal('X1', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 call assert_fails('wnext', 'E163:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 " Test :wnext with a count.
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 args X1 X2 X3
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 call assert_equal('X1', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 2wnext
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 call assert_equal('X3', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 " Test :wnext {file}.
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 args X1 X2 X3
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 wnext X4
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 call assert_equal(['1'], readfile('X4'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 call assert_equal('X2', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 call assert_fails('wnext X4', 'E13:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 call assert_equal(['1'], readfile('X4'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 wnext! X4
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 call assert_equal(['2'], readfile('X4'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 call assert_equal('X3', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 args X1 X2
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 " Commented out as, E13 occurs on Windows instead of E17
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 "call assert_fails('wnext .', 'E17:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 call assert_fails('wnext! .', 'E502:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 %bwipe!
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 call delete('X1')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 call delete('X2')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 call delete('X3')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 call delete('X4')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 endfunc
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 func Test_wprevious()
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51 args X1 X2
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 next
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 call assert_equal('X2', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 call setline(1, '2')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 wprevious
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 call assert_equal(['2'], readfile('X2'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 call assert_equal('X1', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 call setline(1, '1')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 call assert_fails('wprevious', 'E164:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 call assert_fails('wNext', 'E164:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 " Test :wprevious with a single file.
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 args X1
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 call assert_fails('wprevious', 'E163:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 call assert_fails('wNext', 'E163:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 " Test :wprevious with a count.
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 args X1 X2 X3
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 2next
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 call setline(1, '3')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 call assert_equal('X3', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 2wprevious
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 call assert_equal('X1', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 call assert_equal(['3'], readfile('X3'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 " Test :wprevious {file}
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 args X1 X2 X3
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 2next
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 call assert_equal('X3', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 wprevious X4
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 call assert_equal(['3'], readfile('X4'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 call assert_equal('X2', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 call assert_fails('wprevious X4', 'E13:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 call assert_equal(['3'], readfile('X4'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 wprevious! X4
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 call assert_equal(['2'], readfile('X4'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 call assert_equal('X1', bufname('%'))
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 args X1 X2
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 " Commented out as, E13 occurs on Windows instead of E17
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 "call assert_fails('wprevious .', 'E17:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 call assert_fails('wprevious! .', 'E502:')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 %bwipe!
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 call delete('X1')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 call delete('X2')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 call delete('X3')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 call delete('X4')
de068e9acd8e patch 8.1.0926: no test for :wnext, :wNext and :wprevious
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 endfunc