summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0926
blob: 20423a575834cbf1ad2ddf1da16f4d93e0c04409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0926
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0926
Problem:    No test for :wnext, :wNext and :wprevious.
Solution:   Add a test. (Dominique Pelle, closes #3963)
Files:	    src/testdir/Make_all.mak, src/testdir/test_alot.vim,
            src/testdir/test_wnext.vim


*** ../vim-8.1.0925/src/testdir/Make_all.mak	2019-02-08 14:33:54.822761996 +0100
--- src/testdir/Make_all.mak	2019-02-15 20:09:22.963005870 +0100
***************
*** 269,274 ****
--- 269,275 ----
  	test_window_cmd \
  	test_window_id \
  	test_windows_home \
+ 	test_wnext \
  	test_wordcount \
  	test_writefile \
  	test_xxd \
*** ../vim-8.1.0925/src/testdir/test_alot.vim	2019-01-24 22:42:14.949304772 +0100
--- src/testdir/test_alot.vim	2019-02-15 20:09:22.963005870 +0100
***************
*** 66,68 ****
--- 66,69 ----
  source test_unlet.vim
  source test_virtualedit.vim
  source test_window_cmd.vim
+ source test_wnext.vim
*** ../vim-8.1.0925/src/testdir/test_wnext.vim	2019-02-15 20:14:36.220428608 +0100
--- src/testdir/test_wnext.vim	2019-02-15 20:09:22.963005870 +0100
***************
*** 0 ****
--- 1,101 ----
+ " Test :wnext :wNext and :wprevious
+ 
+ func Test_wnext()
+   args X1 X2
+ 
+   call setline(1, '1')
+   wnext
+   call assert_equal(['1'], readfile('X1'))
+   call assert_equal('X2', bufname('%'))
+ 
+   call setline(1, '2')
+   call assert_fails('wnext', 'E165:')
+   call assert_equal(['2'], readfile('X2'))
+   call assert_equal('X2', bufname('%'))
+ 
+   " Test :wnext with a single file.
+   args X1
+   call assert_equal('X1', bufname('%'))
+   call assert_fails('wnext', 'E163:')
+ 
+   " Test :wnext with a count.
+   args X1 X2 X3
+   call assert_equal('X1', bufname('%'))
+   2wnext
+   call assert_equal('X3', bufname('%'))
+ 
+   " Test :wnext {file}.
+   args X1 X2 X3
+   wnext X4
+   call assert_equal(['1'], readfile('X4'))
+   call assert_equal('X2', bufname('%'))
+   call assert_fails('wnext X4', 'E13:')
+   call assert_equal(['1'], readfile('X4'))
+   wnext! X4
+   call assert_equal(['2'], readfile('X4'))
+   call assert_equal('X3', bufname('%'))
+ 
+   args X1 X2
+   " Commented out as, E13 occurs on Windows instead of E17
+   "call assert_fails('wnext .', 'E17:')
+   call assert_fails('wnext! .', 'E502:')
+ 
+   %bwipe!
+   call delete('X1')
+   call delete('X2')
+   call delete('X3')
+   call delete('X4')
+ endfunc
+ 
+ func Test_wprevious()
+   args X1 X2
+ 
+   next
+   call assert_equal('X2', bufname('%'))
+   call setline(1, '2')
+   wprevious
+   call assert_equal(['2'], readfile('X2'))
+   call assert_equal('X1', bufname('%'))
+ 
+   call setline(1, '1')
+   call assert_fails('wprevious', 'E164:')
+   call assert_fails('wNext', 'E164:')
+ 
+   " Test :wprevious with a single file.
+   args X1
+   call assert_fails('wprevious', 'E163:')
+   call assert_fails('wNext', 'E163:')
+ 
+   " Test :wprevious with a count.
+   args X1 X2 X3
+   2next
+   call setline(1, '3')
+   call assert_equal('X3', bufname('%'))
+   2wprevious
+   call assert_equal('X1', bufname('%'))
+   call assert_equal(['3'], readfile('X3'))
+ 
+   " Test :wprevious {file}
+   args X1 X2 X3
+   2next
+   call assert_equal('X3', bufname('%'))
+   wprevious X4
+   call assert_equal(['3'], readfile('X4'))
+   call assert_equal('X2', bufname('%'))
+   call assert_fails('wprevious X4', 'E13:')
+   call assert_equal(['3'], readfile('X4'))
+   wprevious! X4
+   call assert_equal(['2'], readfile('X4'))
+   call assert_equal('X1', bufname('%'))
+ 
+   args X1 X2
+   " Commented out as, E13 occurs on Windows instead of E17
+   "call assert_fails('wprevious .', 'E17:')
+   call assert_fails('wprevious! .', 'E502:')
+ 
+   %bwipe!
+   call delete('X1')
+   call delete('X2')
+   call delete('X3')
+   call delete('X4')
+ endfunc
*** ../vim-8.1.0925/src/version.c	2019-02-15 01:06:09.283099564 +0100
--- src/version.c	2019-02-15 20:14:45.812347475 +0100
***************
*** 785,786 ****
--- 785,788 ----
  {   /* Add new patch number below this line */
+ /**/
+     926,
  /**/

-- 
ARTHUR:       You are indeed brave Sir knight, but the fight is mine.
BLACK KNIGHT: Had enough?
ARTHUR:       You stupid bastard.  You havn't got any arms left.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///