annotate src/testdir/test_wnext.vim @ 27665:a6ffe874a24b v8.2.4358

patch 8.2.4358: Vim9: line number of exception is not set Commit: https://github.com/vim/vim/commit/90a57168a42048eb7e176a4f9acf607c31e8074f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 12 14:23:17 2022 +0000 patch 8.2.4358: Vim9: line number of exception is not set Problem: Vim9: line number of exception is not set. Solution: Set the line number before throwing an exception. (closes https://github.com/vim/vim/issues/9755)
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Feb 2022 15:30:03 +0100
parents 08940efa6b4e
children
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
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 15838
diff changeset
102
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 15838
diff changeset
103 " vim: shiftwidth=2 sts=2 expandtab