Mercurial > vim
comparison src/testdir/test_functions.vim @ 21765:08940efa6b4e v8.2.1432
patch 8.2.1432: various inconsistencies in test files
Commit: https://github.com/vim/vim/commit/6d91bcb4d23b5c6a0be72c384beaf385e2d9d606
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 12 18:50:36 2020 +0200
patch 8.2.1432: various inconsistencies in test files
Problem: Various inconsistencies in test files.
Solution: Add modelines where they were missing. Use Check commands instead
of silently skipping over tests. Adjust indents and comments.
(Ken Takata, closes #6695)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 12 Aug 2020 19:00:08 +0200 |
parents | cbc570e66d11 |
children | 0c0e8cd8c177 |
comparison
equal
deleted
inserted
replaced
21764:476b6faad407 | 21765:08940efa6b4e |
---|---|
1 " Tests for various functions. | 1 " Tests for various functions. |
2 | |
2 source shared.vim | 3 source shared.vim |
3 source check.vim | 4 source check.vim |
4 source term_util.vim | 5 source term_util.vim |
5 source screendump.vim | 6 source screendump.vim |
6 | 7 |
295 unlet $TZ | 296 unlet $TZ |
296 endif | 297 endif |
297 endfunc | 298 endfunc |
298 | 299 |
299 func Test_resolve_unix() | 300 func Test_resolve_unix() |
300 if !has('unix') | 301 CheckUnix |
301 return | |
302 endif | |
303 | 302 |
304 " Xlink1 -> Xlink2 | 303 " Xlink1 -> Xlink2 |
305 " Xlink2 -> Xlink3 | 304 " Xlink2 -> Xlink3 |
306 silent !ln -s -f Xlink2 Xlink1 | 305 silent !ln -s -f Xlink2 Xlink1 |
307 silent !ln -s -f Xlink3 Xlink2 | 306 silent !ln -s -f Xlink3 Xlink2 |
347 let ret = substitute(ret, '//', '/', 'g') | 346 let ret = substitute(ret, '//', '/', 'g') |
348 return ret->tolower() | 347 return ret->tolower() |
349 endfunc | 348 endfunc |
350 | 349 |
351 func Test_resolve_win32() | 350 func Test_resolve_win32() |
352 if !has('win32') | 351 CheckMSWindows |
353 return | |
354 endif | |
355 | 352 |
356 " test for shortcut file | 353 " test for shortcut file |
357 if executable('cscript') | 354 if executable('cscript') |
358 new Xfile | 355 new Xfile |
359 wq | 356 wq |
1241 " check that the relative path works in / | 1238 " check that the relative path works in / |
1242 lcd / | 1239 lcd / |
1243 call assert_equal(1, executable(catcmd)) | 1240 call assert_equal(1, executable(catcmd)) |
1244 call assert_equal('/' .. catcmd, catcmd->exepath()) | 1241 call assert_equal('/' .. catcmd, catcmd->exepath()) |
1245 bwipe | 1242 bwipe |
1243 else | |
1244 throw 'Skipped: does not work on this platform' | |
1246 endif | 1245 endif |
1247 endfunc | 1246 endfunc |
1248 | 1247 |
1249 func Test_executable_longname() | 1248 func Test_executable_longname() |
1250 if !has('win32') | 1249 CheckMSWindows |
1251 return | |
1252 endif | |
1253 | 1250 |
1254 let fname = 'X' . repeat('あ', 200) . '.bat' | 1251 let fname = 'X' . repeat('あ', 200) . '.bat' |
1255 call writefile([], fname) | 1252 call writefile([], fname) |
1256 call assert_equal(1, executable(fname)) | 1253 call assert_equal(1, executable(fname)) |
1257 call delete(fname) | 1254 call delete(fname) |
1416 call assert_fails('call inputlist("")', 'E686:') | 1413 call assert_fails('call inputlist("")', 'E686:') |
1417 call assert_fails('call inputlist(test_null_list())', 'E686:') | 1414 call assert_fails('call inputlist(test_null_list())', 'E686:') |
1418 endfunc | 1415 endfunc |
1419 | 1416 |
1420 func Test_balloon_show() | 1417 func Test_balloon_show() |
1421 if has('balloon_eval') | 1418 CheckFeature balloon_eval |
1422 " This won't do anything but must not crash either. | 1419 " This won't do anything but must not crash either. |
1423 call balloon_show('hi!') | 1420 call balloon_show('hi!') |
1424 if !has('gui_running') | 1421 if !has('gui_running') |
1425 call balloon_show(range(3)) | 1422 call balloon_show(range(3)) |
1426 call balloon_show([]) | 1423 call balloon_show([]) |
1427 endif | |
1428 endif | 1424 endif |
1429 endfunc | 1425 endfunc |
1430 | 1426 |
1431 func Test_setbufvar_options() | 1427 func Test_setbufvar_options() |
1432 " This tests that aucmd_prepbuf() and aucmd_restbuf() properly restore the | 1428 " This tests that aucmd_prepbuf() and aucmd_restbuf() properly restore the |
1652 call assert_equal(3, v:mouse_col) | 1648 call assert_equal(3, v:mouse_col) |
1653 enew! | 1649 enew! |
1654 endfunc | 1650 endfunc |
1655 | 1651 |
1656 func Test_libcall_libcallnr() | 1652 func Test_libcall_libcallnr() |
1657 if !has('libcall') | 1653 CheckFeature libcall |
1658 return | |
1659 endif | |
1660 | 1654 |
1661 if has('win32') | 1655 if has('win32') |
1662 let libc = 'msvcrt.dll' | 1656 let libc = 'msvcrt.dll' |
1663 elseif has('mac') | 1657 elseif has('mac') |
1664 let libc = 'libSystem.B.dylib' | 1658 let libc = 'libSystem.B.dylib' |