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
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0417
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.0417
Problem: Several command line arguments are not tested.
Solution: Add tests for -m, -M, -R and -Vfile. (Dominique Pelle,
closes #3458)
Files: src/testdir/test_startup.vim
*** ../vim-8.1.0416/src/testdir/test_startup.vim 2018-09-19 21:06:28.344234982 +0200
--- src/testdir/test_startup.vim 2018-09-21 12:52:01.786654278 +0200
***************
*** 194,201 ****
" Open 2 windows split vertically. Expect:
" - 2 windows
" - both windows should have the same or almost the same width
! " - sum of both windows width (+ 1 separator) should be equal to the
! " number of columns
" - both windows should have the same height
" - window height (+ 2 for the statusline and Ex command) should be equal
" to the number of lines
--- 194,201 ----
" Open 2 windows split vertically. Expect:
" - 2 windows
" - both windows should have the same or almost the same width
! " - sum of both windows width (+ 1 for the separator) should be equal to
! " the number of columns
" - both windows should have the same height
" - window height (+ 2 for the statusline and Ex command) should be equal
" to the number of lines
***************
*** 269,274 ****
--- 269,316 ----
call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\r\nline 1: \" The default vimrc file\..* verbose=15\n", out)
endfunc
+ " Test the -V[N]{filename} argument to set the 'verbose' option to N
+ " and set 'verbosefile' to filename.
+ func Test_V_file_arg()
+ if RunVim([], [], ' --clean -X -V2Xverbosefile -c "set verbose? verbosefile?" -cq')
+ let out = join(readfile('Xverbosefile'), "\n")
+ call assert_match("sourcing \"$VIMRUNTIME[\\/]defaults\.vim\"\n", out)
+ call assert_match("\n verbose=2\n", out)
+ call assert_match("\n verbosefile=Xverbosefile", out)
+ endif
+
+ call delete('Xverbosefile')
+ endfunc
+
+ " Test the -m, -M and -R arguments:
+ " -m resets 'write'
+ " -M resets 'modifiable' and 'write'
+ " -R sets 'readonly'
+ func Test_m_M_R()
+ let after = [
+ \ 'call writefile([&write, &modifiable, &readonly, &updatecount], "Xtestout")',
+ \ 'qall',
+ \ ]
+ if RunVim([], after, '')
+ let lines = readfile('Xtestout')
+ call assert_equal(['1', '1', '0', '200'], lines)
+ endif
+ if RunVim([], after, '-m')
+ let lines = readfile('Xtestout')
+ call assert_equal(['0', '1', '0', '200'], lines)
+ endif
+ if RunVim([], after, '-M')
+ let lines = readfile('Xtestout')
+ call assert_equal(['0', '0', '0', '200'], lines)
+ endif
+ if RunVim([], after, '-R')
+ let lines = readfile('Xtestout')
+ call assert_equal(['1', '1', '1', '10000'], lines)
+ endif
+
+ call delete('Xtestout')
+ endfunc
+
" Test the -A, -F and -H arguments (Arabic, Farsi and Hebrew modes).
func Test_A_F_H_arg()
let after = [
***************
*** 430,436 ****
call writefile(['123456'], 'Xtestout')
let after = [
\ ':startinsert',
! \ 'call feedkeys("foobar\<c-o>:wq\<cr>","t")'
\ ]
if RunVim([], after, 'Xtestout')
let lines = readfile('Xtestout')
--- 472,478 ----
call writefile(['123456'], 'Xtestout')
let after = [
\ ':startinsert',
! \ 'call feedkeys("foobar\<c-o>:wq\<cr>","t")'
\ ]
if RunVim([], after, 'Xtestout')
let lines = readfile('Xtestout')
***************
*** 440,446 ****
call writefile(['123456'], 'Xtestout')
let after = [
\ ':startinsert!',
! \ 'call feedkeys("foobar\<c-o>:wq\<cr>","t")'
\ ]
if RunVim([], after, 'Xtestout')
let lines = readfile('Xtestout')
--- 482,488 ----
call writefile(['123456'], 'Xtestout')
let after = [
\ ':startinsert!',
! \ 'call feedkeys("foobar\<c-o>:wq\<cr>","t")'
\ ]
if RunVim([], after, 'Xtestout')
let lines = readfile('Xtestout')
*** ../vim-8.1.0416/src/version.c 2018-09-21 12:46:16.341772938 +0200
--- src/version.c 2018-09-21 12:53:03.382109316 +0200
***************
*** 796,797 ****
--- 796,799 ----
{ /* Add new patch number below this line */
+ /**/
+ 417,
/**/
--
From "know your smileys":
<>:-) Bishop
/// 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 ///
|