Bram Moolenaar | c8ce615 | 2016-08-07 13:48:20 +0200 | [diff] [blame] | 1 | " Test for options |
| 2 | |
| 3 | function! Test_whichwrap() |
| 4 | set whichwrap=b,s |
| 5 | call assert_equal('b,s', &whichwrap) |
| 6 | |
| 7 | set whichwrap+=h,l |
| 8 | call assert_equal('b,s,h,l', &whichwrap) |
| 9 | |
| 10 | set whichwrap+=h,l |
| 11 | call assert_equal('b,s,h,l', &whichwrap) |
| 12 | |
| 13 | set whichwrap+=h,l |
| 14 | call assert_equal('b,s,h,l', &whichwrap) |
| 15 | |
Bram Moolenaar | aaaf57d | 2017-02-05 14:13:20 +0100 | [diff] [blame] | 16 | set whichwrap=h,h |
| 17 | call assert_equal('h', &whichwrap) |
| 18 | |
| 19 | set whichwrap=h,h,h |
| 20 | call assert_equal('h', &whichwrap) |
| 21 | |
Bram Moolenaar | c8ce615 | 2016-08-07 13:48:20 +0200 | [diff] [blame] | 22 | set whichwrap& |
| 23 | endfunction |
| 24 | |
Bram Moolenaar | 187a4f2 | 2017-02-23 17:07:14 +0100 | [diff] [blame] | 25 | function! Test_isfname() |
| 26 | " This used to cause Vim to access uninitialized memory. |
| 27 | set isfname= |
| 28 | call assert_equal("~X", expand("~X")) |
| 29 | set isfname& |
| 30 | endfunction |
| 31 | |
Bram Moolenaar | a12e403 | 2017-02-25 21:37:57 +0100 | [diff] [blame] | 32 | function Test_wildchar() |
| 33 | " Empty 'wildchar' used to access invalid memory. |
| 34 | call assert_fails('set wildchar=', 'E521:') |
| 35 | call assert_fails('set wildchar=abc', 'E521:') |
| 36 | set wildchar=<Esc> |
| 37 | let a=execute('set wildchar?') |
| 38 | call assert_equal("\n wildchar=<Esc>", a) |
| 39 | set wildchar=27 |
| 40 | let a=execute('set wildchar?') |
| 41 | call assert_equal("\n wildchar=<Esc>", a) |
| 42 | set wildchar& |
| 43 | endfunction |
| 44 | |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 45 | function Test_options() |
Bram Moolenaar | c8ce615 | 2016-08-07 13:48:20 +0200 | [diff] [blame] | 46 | let caught = 'ok' |
| 47 | try |
| 48 | options |
| 49 | catch |
| 50 | let caught = v:throwpoint . "\n" . v:exception |
| 51 | endtry |
| 52 | call assert_equal('ok', caught) |
| 53 | |
| 54 | " close option-window |
| 55 | close |
| 56 | endfunction |
| 57 | |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 58 | function Test_path_keep_commas() |
Bram Moolenaar | c8ce615 | 2016-08-07 13:48:20 +0200 | [diff] [blame] | 59 | " Test that changing 'path' keeps two commas. |
| 60 | set path=foo,,bar |
| 61 | set path-=bar |
| 62 | set path+=bar |
| 63 | call assert_equal('foo,,bar', &path) |
| 64 | |
| 65 | set path& |
| 66 | endfunction |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 67 | |
| 68 | func Test_signcolumn() |
Bram Moolenaar | ebcccad | 2016-08-12 19:17:13 +0200 | [diff] [blame] | 69 | if has('signs') |
| 70 | call assert_equal("auto", &signcolumn) |
| 71 | set signcolumn=yes |
| 72 | set signcolumn=no |
| 73 | call assert_fails('set signcolumn=nope') |
| 74 | endif |
Bram Moolenaar | 95ec9d6 | 2016-08-12 18:29:59 +0200 | [diff] [blame] | 75 | endfunc |
| 76 | |
Bram Moolenaar | d0b5138 | 2016-11-04 15:23:45 +0100 | [diff] [blame] | 77 | func Test_filetype_valid() |
Bram Moolenaar | 9376f5f | 2016-11-04 16:41:20 +0100 | [diff] [blame] | 78 | if !has('autocmd') |
| 79 | return |
| 80 | endif |
Bram Moolenaar | d0b5138 | 2016-11-04 15:23:45 +0100 | [diff] [blame] | 81 | set ft=valid_name |
| 82 | call assert_equal("valid_name", &filetype) |
| 83 | set ft=valid-name |
| 84 | call assert_equal("valid-name", &filetype) |
| 85 | |
| 86 | call assert_fails(":set ft=wrong;name", "E474:") |
| 87 | call assert_fails(":set ft=wrong\\\\name", "E474:") |
| 88 | call assert_fails(":set ft=wrong\\|name", "E474:") |
| 89 | call assert_fails(":set ft=wrong/name", "E474:") |
| 90 | call assert_fails(":set ft=wrong\\\nname", "E474:") |
| 91 | call assert_equal("valid-name", &filetype) |
| 92 | |
| 93 | exe "set ft=trunc\x00name" |
| 94 | call assert_equal("trunc", &filetype) |
| 95 | endfunc |
| 96 | |
| 97 | func Test_syntax_valid() |
Bram Moolenaar | 9376f5f | 2016-11-04 16:41:20 +0100 | [diff] [blame] | 98 | if !has('syntax') |
| 99 | return |
| 100 | endif |
Bram Moolenaar | d0b5138 | 2016-11-04 15:23:45 +0100 | [diff] [blame] | 101 | set syn=valid_name |
| 102 | call assert_equal("valid_name", &syntax) |
| 103 | set syn=valid-name |
| 104 | call assert_equal("valid-name", &syntax) |
| 105 | |
| 106 | call assert_fails(":set syn=wrong;name", "E474:") |
| 107 | call assert_fails(":set syn=wrong\\\\name", "E474:") |
| 108 | call assert_fails(":set syn=wrong\\|name", "E474:") |
| 109 | call assert_fails(":set syn=wrong/name", "E474:") |
| 110 | call assert_fails(":set syn=wrong\\\nname", "E474:") |
| 111 | call assert_equal("valid-name", &syntax) |
| 112 | |
| 113 | exe "set syn=trunc\x00name" |
| 114 | call assert_equal("trunc", &syntax) |
| 115 | endfunc |
| 116 | |
| 117 | func Test_keymap_valid() |
Bram Moolenaar | 9376f5f | 2016-11-04 16:41:20 +0100 | [diff] [blame] | 118 | if !has('keymap') |
| 119 | return |
| 120 | endif |
Bram Moolenaar | d0b5138 | 2016-11-04 15:23:45 +0100 | [diff] [blame] | 121 | call assert_fails(":set kmp=valid_name", "E544:") |
| 122 | call assert_fails(":set kmp=valid_name", "valid_name") |
| 123 | call assert_fails(":set kmp=valid-name", "E544:") |
| 124 | call assert_fails(":set kmp=valid-name", "valid-name") |
| 125 | |
| 126 | call assert_fails(":set kmp=wrong;name", "E474:") |
| 127 | call assert_fails(":set kmp=wrong\\\\name", "E474:") |
| 128 | call assert_fails(":set kmp=wrong\\|name", "E474:") |
| 129 | call assert_fails(":set kmp=wrong/name", "E474:") |
| 130 | call assert_fails(":set kmp=wrong\\\nname", "E474:") |
| 131 | |
| 132 | call assert_fails(":set kmp=trunc\x00name", "E544:") |
| 133 | call assert_fails(":set kmp=trunc\x00name", "trunc") |
| 134 | endfunc |
Bram Moolenaar | 7554da4 | 2016-11-25 22:04:13 +0100 | [diff] [blame] | 135 | |
Bram Moolenaar | f422bcc | 2016-11-26 17:45:53 +0100 | [diff] [blame] | 136 | func Check_dir_option(name) |
Bram Moolenaar | 7554da4 | 2016-11-25 22:04:13 +0100 | [diff] [blame] | 137 | " Check that it's possible to set the option. |
Bram Moolenaar | f422bcc | 2016-11-26 17:45:53 +0100 | [diff] [blame] | 138 | exe 'set ' . a:name . '=/usr/share/dict/words' |
| 139 | call assert_equal('/usr/share/dict/words', eval('&' . a:name)) |
| 140 | exe 'set ' . a:name . '=/usr/share/dict/words,/and/there' |
| 141 | call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name)) |
| 142 | exe 'set ' . a:name . '=/usr/share/dict\ words' |
| 143 | call assert_equal('/usr/share/dict words', eval('&' . a:name)) |
Bram Moolenaar | 7554da4 | 2016-11-25 22:04:13 +0100 | [diff] [blame] | 144 | |
| 145 | " Check rejecting weird characters. |
Bram Moolenaar | f422bcc | 2016-11-26 17:45:53 +0100 | [diff] [blame] | 146 | call assert_fails("set " . a:name . "=/not&there", "E474:") |
| 147 | call assert_fails("set " . a:name . "=/not>there", "E474:") |
| 148 | call assert_fails("set " . a:name . "=/not.*there", "E474:") |
| 149 | endfunc |
| 150 | |
Bram Moolenaar | 60629d6 | 2017-02-23 18:08:56 +0100 | [diff] [blame] | 151 | func Test_cinkeys() |
| 152 | " This used to cause invalid memory access |
| 153 | set cindent cinkeys=0 |
| 154 | norm a |
| 155 | set cindent& cinkeys& |
| 156 | endfunc |
| 157 | |
Bram Moolenaar | f422bcc | 2016-11-26 17:45:53 +0100 | [diff] [blame] | 158 | func Test_dictionary() |
| 159 | call Check_dir_option('dictionary') |
| 160 | endfunc |
| 161 | |
| 162 | func Test_thesaurus() |
| 163 | call Check_dir_option('thesaurus') |
Bram Moolenaar | 698f8b2 | 2017-02-04 15:53:32 +0100 | [diff] [blame] | 164 | endfun |
| 165 | |
Bram Moolenaar | 226c534 | 2017-02-17 14:53:15 +0100 | [diff] [blame] | 166 | func Test_complete() |
| 167 | " Trailing single backslash used to cause invalid memory access. |
| 168 | set complete=s\ |
| 169 | new |
| 170 | call feedkeys("i\<C-N>\<Esc>", 'xt') |
| 171 | bwipe! |
| 172 | set complete& |
| 173 | endfun |
| 174 | |
Bram Moolenaar | 698f8b2 | 2017-02-04 15:53:32 +0100 | [diff] [blame] | 175 | func Test_set_completion() |
| 176 | call feedkeys(":set di\<C-A>\<C-B>\"\<CR>", 'tx') |
| 177 | call assert_equal('"set dictionary diff diffexpr diffopt digraph directory display', @:) |
| 178 | |
| 179 | " Expand boolan options. When doing :set no<Tab> |
| 180 | " vim displays the options names without "no" but completion uses "no...". |
| 181 | call feedkeys(":set nodi\<C-A>\<C-B>\"\<CR>", 'tx') |
| 182 | call assert_equal('"set nodiff digraph', @:) |
| 183 | |
| 184 | call feedkeys(":set invdi\<C-A>\<C-B>\"\<CR>", 'tx') |
| 185 | call assert_equal('"set invdiff digraph', @:) |
| 186 | |
| 187 | " Expand abbreviation of options. |
| 188 | call feedkeys(":set ts\<C-A>\<C-B>\"\<CR>", 'tx') |
| 189 | call assert_equal('"set tabstop thesaurus ttyscroll', @:) |
| 190 | |
| 191 | " Expand current value |
| 192 | call feedkeys(":set fileencodings=\<C-A>\<C-B>\"\<CR>", 'tx') |
| 193 | call assert_equal('"set fileencodings=ucs-bom,utf-8,default,latin1', @:) |
| 194 | |
| 195 | call feedkeys(":set fileencodings:\<C-A>\<C-B>\"\<CR>", 'tx') |
| 196 | call assert_equal('"set fileencodings:ucs-bom,utf-8,default,latin1', @:) |
| 197 | |
| 198 | " Expand key codes. |
| 199 | call feedkeys(":set <H\<C-A>\<C-B>\"\<CR>", 'tx') |
| 200 | call assert_equal('"set <Help> <Home>', @:) |
| 201 | |
| 202 | " Expand terminal options. |
| 203 | call feedkeys(":set t_A\<C-A>\<C-B>\"\<CR>", 'tx') |
| 204 | call assert_equal('"set t_AB t_AF t_AL', @:) |
| 205 | |
| 206 | " Expand directories. |
| 207 | call feedkeys(":set cdpath=./\<C-A>\<C-B>\"\<CR>", 'tx') |
| 208 | call assert_match(' ./samples/ ', @:) |
| 209 | call assert_notmatch(' ./small.vim ', @:) |
| 210 | |
| 211 | " Expand files and directories. |
| 212 | call feedkeys(":set tags=./\<C-A>\<C-B>\"\<CR>", 'tx') |
| 213 | call assert_match(' ./samples/.* ./small.vim', @:) |
| 214 | |
| 215 | call feedkeys(":set tags=./\\\\ dif\<C-A>\<C-B>\"\<CR>", 'tx') |
| 216 | call assert_equal('"set tags=./\\ diff diffexpr diffopt', @:) |
| 217 | endfunc |
| 218 | |
| 219 | func Test_set_errors() |
| 220 | call assert_fails('set scroll=-1', 'E49:') |
| 221 | call assert_fails('set backupcopy=', 'E474:') |
| 222 | call assert_fails('set regexpengine=3', 'E474:') |
| 223 | call assert_fails('set history=10001', 'E474:') |
| 224 | call assert_fails('set numberwidth=11', 'E474:') |
| 225 | call assert_fails('set colorcolumn=-a') |
| 226 | call assert_fails('set colorcolumn=a') |
| 227 | call assert_fails('set colorcolumn=1,') |
| 228 | call assert_fails('set cmdheight=-1', 'E487:') |
| 229 | call assert_fails('set cmdwinheight=-1', 'E487:') |
| 230 | if has('conceal') |
| 231 | call assert_fails('set conceallevel=-1', 'E487:') |
| 232 | call assert_fails('set conceallevel=4', 'E474:') |
| 233 | endif |
| 234 | call assert_fails('set helpheight=-1', 'E487:') |
| 235 | call assert_fails('set history=-1', 'E487:') |
| 236 | call assert_fails('set report=-1', 'E487:') |
| 237 | call assert_fails('set shiftwidth=-1', 'E487:') |
| 238 | call assert_fails('set sidescroll=-1', 'E487:') |
| 239 | call assert_fails('set tabstop=-1', 'E487:') |
| 240 | call assert_fails('set textwidth=-1', 'E487:') |
| 241 | call assert_fails('set timeoutlen=-1', 'E487:') |
| 242 | call assert_fails('set updatecount=-1', 'E487:') |
| 243 | call assert_fails('set updatetime=-1', 'E487:') |
| 244 | call assert_fails('set winheight=-1', 'E487:') |
| 245 | call assert_fails('set tabstop!', 'E488:') |
| 246 | call assert_fails('set xxx', 'E518:') |
| 247 | call assert_fails('set beautify?', 'E519:') |
| 248 | call assert_fails('set undolevels=x', 'E521:') |
| 249 | call assert_fails('set tabstop=', 'E521:') |
| 250 | call assert_fails('set comments=-', 'E524:') |
| 251 | call assert_fails('set comments=a', 'E525:') |
| 252 | call assert_fails('set foldmarker=x', 'E536:') |
| 253 | call assert_fails('set commentstring=x', 'E537:') |
| 254 | call assert_fails('set complete=x', 'E539:') |
| 255 | call assert_fails('set statusline=%{', 'E540:') |
| 256 | call assert_fails('set statusline=' . repeat("%p", 81), 'E541:') |
| 257 | call assert_fails('set statusline=%(', 'E542:') |
Bram Moolenaar | 24922ec | 2017-02-23 17:59:22 +0100 | [diff] [blame] | 258 | if has('cursorshape') |
| 259 | " This invalid value for 'guicursor' used to cause Vim to crash. |
| 260 | call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:') |
| 261 | call assert_fails('set guicursor=i-ci', 'E545:') |
| 262 | call assert_fails('set guicursor=x', 'E545:') |
| 263 | call assert_fails('set guicursor=r-cr:horx', 'E548:') |
| 264 | call assert_fails('set guicursor=r-cr:hor0', 'E549:') |
| 265 | endif |
Bram Moolenaar | 698f8b2 | 2017-02-04 15:53:32 +0100 | [diff] [blame] | 266 | call assert_fails('set backupext=~ patchmode=~', 'E589:') |
| 267 | call assert_fails('set winminheight=10 winheight=9', 'E591:') |
| 268 | call assert_fails('set winminwidth=10 winwidth=9', 'E592:') |
| 269 | call assert_fails("set showbreak=\x01", 'E595:') |
| 270 | call assert_fails('set t_foo=', 'E846:') |
Bram Moolenaar | 7554da4 | 2016-11-25 22:04:13 +0100 | [diff] [blame] | 271 | endfunc |
Bram Moolenaar | 6739114 | 2017-02-19 21:07:04 +0100 | [diff] [blame] | 272 | |
| 273 | func Test_set_ttytype() |
| 274 | if !has('gui_running') && has('unix') |
| 275 | " Setting 'ttytype' used to cause a double-free when exiting vim and |
| 276 | " when vim is compiled with -DEXITFREE. |
| 277 | set ttytype=ansi |
| 278 | call assert_equal('ansi', &ttytype) |
| 279 | call assert_equal(&ttytype, &term) |
| 280 | set ttytype=xterm |
| 281 | call assert_equal('xterm', &ttytype) |
| 282 | call assert_equal(&ttytype, &term) |
Bram Moolenaar | f803a76 | 2017-04-09 22:54:13 +0200 | [diff] [blame] | 283 | " "set ttytype=" gives E522 instead of E529 |
| 284 | " in travis on some builds. Why? Catch both for now |
| 285 | try |
| 286 | set ttytype= |
Bram Moolenaar | 69e0569 | 2018-05-10 14:11:52 +0200 | [diff] [blame] | 287 | call assert_report('set ttytype= did not fail') |
Bram Moolenaar | f803a76 | 2017-04-09 22:54:13 +0200 | [diff] [blame] | 288 | catch /E529\|E522/ |
| 289 | endtry |
| 290 | |
| 291 | " Some systems accept any terminal name and return dumb settings, |
| 292 | " check for failure of finding the entry and for missing 'cm' entry. |
| 293 | try |
| 294 | set ttytype=xxx |
Bram Moolenaar | 69e0569 | 2018-05-10 14:11:52 +0200 | [diff] [blame] | 295 | call assert_report('set ttytype=xxx did not fail') |
Bram Moolenaar | f803a76 | 2017-04-09 22:54:13 +0200 | [diff] [blame] | 296 | catch /E522\|E437/ |
| 297 | endtry |
| 298 | |
Bram Moolenaar | 6739114 | 2017-02-19 21:07:04 +0100 | [diff] [blame] | 299 | set ttytype& |
| 300 | call assert_equal(&ttytype, &term) |
| 301 | endif |
| 302 | endfunc |
Bram Moolenaar | 2f5463d | 2017-02-25 20:40:46 +0100 | [diff] [blame] | 303 | |
| 304 | func Test_set_all() |
| 305 | set tw=75 |
| 306 | set iskeyword=a-z,A-Z |
| 307 | set nosplitbelow |
| 308 | let out = execute('set all') |
| 309 | call assert_match('textwidth=75', out) |
| 310 | call assert_match('iskeyword=a-z,A-Z', out) |
| 311 | call assert_match('nosplitbelow', out) |
| 312 | set tw& iskeyword& splitbelow& |
| 313 | endfunc |
| 314 | |
| 315 | func Test_set_values() |
Bram Moolenaar | 2f5463d | 2017-02-25 20:40:46 +0100 | [diff] [blame] | 316 | if filereadable('opt_test.vim') |
| 317 | source opt_test.vim |
Bram Moolenaar | e8512d7 | 2017-03-07 22:33:32 +0100 | [diff] [blame] | 318 | else |
| 319 | throw 'Skipped: opt_test.vim does not exist' |
Bram Moolenaar | 2f5463d | 2017-02-25 20:40:46 +0100 | [diff] [blame] | 320 | endif |
| 321 | endfunc |
Bram Moolenaar | a701b3b | 2017-04-20 22:57:27 +0200 | [diff] [blame] | 322 | |
| 323 | func ResetIndentexpr() |
| 324 | set indentexpr= |
| 325 | endfunc |
| 326 | |
| 327 | func Test_set_indentexpr() |
| 328 | " this was causing usage of freed memory |
| 329 | set indentexpr=ResetIndentexpr() |
| 330 | new |
| 331 | call feedkeys("i\<c-f>", 'x') |
| 332 | call assert_equal('', &indentexpr) |
| 333 | bwipe! |
| 334 | endfunc |
Bram Moolenaar | b8e22a0 | 2018-04-12 21:37:34 +0200 | [diff] [blame] | 335 | |
| 336 | func Test_backupskip() |
| 337 | if has("mac") |
| 338 | call assert_match('/private/tmp/\*', &bsk) |
| 339 | elseif has("unix") |
| 340 | call assert_match('/tmp/\*', &bsk) |
| 341 | endif |
| 342 | |
| 343 | let bskvalue = substitute(&bsk, '\\', '/', 'g') |
| 344 | for var in ['$TEMPDIR', '$TMP', '$TEMP'] |
| 345 | if exists(var) |
| 346 | let varvalue = substitute(expand(var), '\\', '/', 'g') |
Bram Moolenaar | f53c692 | 2018-08-11 17:53:04 +0200 | [diff] [blame] | 347 | call assert_match(varvalue . '/\=\*', bskvalue) |
Bram Moolenaar | b8e22a0 | 2018-04-12 21:37:34 +0200 | [diff] [blame] | 348 | endif |
| 349 | endfor |
| 350 | endfunc |
Bram Moolenaar | 25782a7 | 2018-05-13 18:05:33 +0200 | [diff] [blame] | 351 | |
| 352 | func Test_copy_winopt() |
| 353 | set hidden |
| 354 | |
| 355 | " Test copy option from current buffer in window |
| 356 | split |
| 357 | enew |
| 358 | setlocal numberwidth=5 |
| 359 | wincmd w |
| 360 | call assert_equal(4,&numberwidth) |
| 361 | bnext |
| 362 | call assert_equal(5,&numberwidth) |
| 363 | bw! |
| 364 | call assert_equal(4,&numberwidth) |
| 365 | |
| 366 | " Test copy value from window that used to be display the buffer |
| 367 | split |
| 368 | enew |
| 369 | setlocal numberwidth=6 |
| 370 | bnext |
| 371 | wincmd w |
| 372 | call assert_equal(4,&numberwidth) |
| 373 | bnext |
| 374 | call assert_equal(6,&numberwidth) |
| 375 | bw! |
| 376 | |
| 377 | " Test that if buffer is current, don't use the stale cached value |
| 378 | " from the last time the buffer was displayed. |
| 379 | split |
| 380 | enew |
| 381 | setlocal numberwidth=7 |
| 382 | bnext |
| 383 | bnext |
| 384 | setlocal numberwidth=8 |
| 385 | wincmd w |
| 386 | call assert_equal(4,&numberwidth) |
| 387 | bnext |
| 388 | call assert_equal(8,&numberwidth) |
| 389 | bw! |
| 390 | |
| 391 | " Test value is not copied if window already has seen the buffer |
| 392 | enew |
| 393 | split |
| 394 | setlocal numberwidth=9 |
| 395 | bnext |
| 396 | setlocal numberwidth=10 |
| 397 | wincmd w |
| 398 | call assert_equal(4,&numberwidth) |
| 399 | bnext |
| 400 | call assert_equal(4,&numberwidth) |
| 401 | bw! |
| 402 | endfunc |
Bram Moolenaar | fc08960 | 2018-06-24 16:53:35 +0200 | [diff] [blame] | 403 | |
| 404 | func Test_shortmess_F() |
| 405 | new |
| 406 | call assert_match('\[No Name\]', execute('file')) |
| 407 | set shortmess+=F |
| 408 | call assert_match('\[No Name\]', execute('file')) |
| 409 | call assert_match('^\s*$', execute('file foo')) |
| 410 | call assert_match('foo', execute('file')) |
| 411 | set shortmess-=F |
| 412 | call assert_match('bar', execute('file bar')) |
| 413 | call assert_match('bar', execute('file')) |
| 414 | set shortmess& |
| 415 | bwipe |
| 416 | endfunc |