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)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index e6c7ec0..ca8cc04 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -70,9 +70,7 @@
endfunc
func Test_cursorhold_insert_with_timer_interrupt()
- if !has('job')
- return
- endif
+ CheckFeature job
" Need to move the cursor.
call feedkeys("ggG", "xt")
@@ -535,9 +533,7 @@
endfunc
func Test_OptionSet()
- if !has("eval") || !exists("+autochdir")
- return
- endif
+ CheckOption autochdir
badd test_autocmd.vim
@@ -1778,12 +1774,11 @@
endfunc
func Test_nocatch_wipe_dummy_buffer()
- if has('quickfix')
- " Nasty autocommand: wipe buffer on any event.
- au * x bwipe
- call assert_fails('lv½ /x', 'E937')
- au!
- endif
+ CheckFeature quickfix
+ " Nasty autocommand: wipe buffer on any event.
+ au * x bwipe
+ call assert_fails('lv½ /x', 'E937')
+ au!
endfunc
function s:Before_test_dirchanged()
@@ -1834,9 +1829,7 @@
endfunc
function Test_dirchanged_auto()
- if !exists('+autochdir')
- return
- endif
+ CheckOption autochdir
call s:Before_test_dirchanged()
call test_autochdir()
autocmd test_dirchanged DirChanged auto call add(s:li, "auto:")
@@ -2087,9 +2080,8 @@
" - FileReadPost decompress the file
func Test_ReadWrite_Autocmds()
" Run this test only on Unix-like systems and if gzip is available
- if !has('unix') || !executable("gzip")
- return
- endif
+ CheckUnix
+ CheckExecutable gzip
" Make $GZIP empty, "-v" would cause trouble.
let $GZIP = ""