comparison src/testdir/test_help.vim @ 29970:d891115c0aea v9.0.0323

patch 9.0.0323: using common name in tests leads to flaky tests Commit: https://github.com/vim/vim/commit/3b0d70f4ff436cb144683dafd956e8a3ee485a90 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 29 22:31:20 2022 +0100 patch 9.0.0323: using common name in tests leads to flaky tests Problem: Using common name in tests leads to flaky tests. Solution: Rename files and directories to be more specific.
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Aug 2022 23:45:04 +0200
parents af4ffc4b2a26
children bcd204e28fed
comparison
equal deleted inserted replaced
29969:5f2d38cacd6c 29970:d891115c0aea
127 endfunc 127 endfunc
128 128
129 " Test for the :helptags command 129 " Test for the :helptags command
130 " NOTE: if you run tests as root this will fail. Don't run tests as root! 130 " NOTE: if you run tests as root this will fail. Don't run tests as root!
131 func Test_helptag_cmd() 131 func Test_helptag_cmd()
132 call mkdir('Xdir/a/doc', 'p') 132 call mkdir('Xtagdir/a/doc', 'p')
133 133
134 " No help file to process in the directory 134 " No help file to process in the directory
135 call assert_fails('helptags Xdir', 'E151:') 135 call assert_fails('helptags Xtagdir', 'E151:')
136 136
137 call writefile([], 'Xdir/a/doc/sample.txt') 137 call writefile([], 'Xtagdir/a/doc/sample.txt')
138 138
139 " Test for ++t argument 139 " Test for ++t argument
140 helptags ++t Xdir 140 helptags ++t Xtagdir
141 call assert_equal(["help-tags\ttags\t1"], readfile('Xdir/tags')) 141 call assert_equal(["help-tags\ttags\t1"], readfile('Xtagdir/tags'))
142 call delete('Xdir/tags') 142 call delete('Xtagdir/tags')
143 143
144 " Test parsing tags 144 " Test parsing tags
145 call writefile(['*tag1*', 'Example: >', ' *notag*', 'Example end: *tag2*'], 145 call writefile(['*tag1*', 'Example: >', ' *notag*', 'Example end: *tag2*'],
146 \ 'Xdir/a/doc/sample.txt') 146 \ 'Xtagdir/a/doc/sample.txt')
147 helptags Xdir 147 helptags Xtagdir
148 call assert_equal(["tag1\ta/doc/sample.txt\t/*tag1*", 148 call assert_equal(["tag1\ta/doc/sample.txt\t/*tag1*",
149 \ "tag2\ta/doc/sample.txt\t/*tag2*"], readfile('Xdir/tags')) 149 \ "tag2\ta/doc/sample.txt\t/*tag2*"], readfile('Xtagdir/tags'))
150 150
151 " Duplicate tags in the help file 151 " Duplicate tags in the help file
152 call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xdir/a/doc/sample.txt') 152 call writefile(['*tag1*', '*tag1*', '*tag2*'], 'Xtagdir/a/doc/sample.txt')
153 call assert_fails('helptags Xdir', 'E154:') 153 call assert_fails('helptags Xtagdir', 'E154:')
154 154
155 call delete('Xdir', 'rf') 155 call delete('Xtagdir', 'rf')
156 endfunc 156 endfunc
157 157
158 func Test_helptag_cmd_readonly() 158 func Test_helptag_cmd_readonly()
159 CheckUnix 159 CheckUnix
160 CheckNotRoot 160 CheckNotRoot
161 161
162 " Read-only tags file 162 " Read-only tags file
163 call mkdir('Xdir/doc', 'p') 163 call mkdir('Xrodir/doc', 'p')
164 call writefile([''], 'Xdir/doc/tags') 164 call writefile([''], 'Xrodir/doc/tags')
165 call writefile([], 'Xdir/doc/sample.txt') 165 call writefile([], 'Xrodir/doc/sample.txt')
166 call setfperm('Xdir/doc/tags', 'r-xr--r--') 166 call setfperm('Xrodir/doc/tags', 'r-xr--r--')
167 call assert_fails('helptags Xdir/doc', 'E152:', getfperm('Xdir/doc/tags')) 167 call assert_fails('helptags Xrodir/doc', 'E152:', getfperm('Xrodir/doc/tags'))
168 168
169 let rtp = &rtp 169 let rtp = &rtp
170 let &rtp = 'Xdir' 170 let &rtp = 'Xrodir'
171 helptags ALL 171 helptags ALL
172 let &rtp = rtp 172 let &rtp = rtp
173 173
174 call delete('Xdir/doc/tags') 174 call delete('Xrodir/doc/tags')
175 175
176 " No permission to read the help file 176 " No permission to read the help file
177 call mkdir('Xdir/b/doc', 'p') 177 call mkdir('Xrodir/b/doc', 'p')
178 call writefile([], 'Xdir/b/doc/sample.txt') 178 call writefile([], 'Xrodir/b/doc/sample.txt')
179 call setfperm('Xdir/b/doc/sample.txt', '-w-------') 179 call setfperm('Xrodir/b/doc/sample.txt', '-w-------')
180 call assert_fails('helptags Xdir', 'E153:', getfperm('Xdir/b/doc/sample.txt')) 180 call assert_fails('helptags Xrodir', 'E153:', getfperm('Xrodir/b/doc/sample.txt'))
181 call delete('Xdir', 'rf') 181 call delete('Xrodir', 'rf')
182 endfunc 182 endfunc
183 183
184 " Test for setting the 'helpheight' option in the help window 184 " Test for setting the 'helpheight' option in the help window
185 func Test_help_window_height() 185 func Test_help_window_height()
186 let &cmdheight = &lines - 23 186 let &cmdheight = &lines - 23