comparison src/testdir/test_autocmd.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 5dcdb970111b
children 0ae284aaa8a2
comparison
equal deleted inserted replaced
21764:476b6faad407 21765:08940efa6b4e
68 au! CursorHoldI 68 au! CursorHoldI
69 set updatetime& 69 set updatetime&
70 endfunc 70 endfunc
71 71
72 func Test_cursorhold_insert_with_timer_interrupt() 72 func Test_cursorhold_insert_with_timer_interrupt()
73 if !has('job') 73 CheckFeature job
74 return
75 endif
76 " Need to move the cursor. 74 " Need to move the cursor.
77 call feedkeys("ggG", "xt") 75 call feedkeys("ggG", "xt")
78 76
79 " Confirm the timer invoked in exit_cb of the job doesn't disturb 77 " Confirm the timer invoked in exit_cb of the job doesn't disturb
80 " CursorHoldI event. 78 " CursorHoldI event.
533 let g:opt = [expected, actual] 531 let g:opt = [expected, actual]
534 "call assert_equal(expected, actual) 532 "call assert_equal(expected, actual)
535 endfunc 533 endfunc
536 534
537 func Test_OptionSet() 535 func Test_OptionSet()
538 if !has("eval") || !exists("+autochdir") 536 CheckOption autochdir
539 return
540 endif
541 537
542 badd test_autocmd.vim 538 badd test_autocmd.vim
543 539
544 call test_override('starting', 1) 540 call test_override('starting', 1)
545 set nocp 541 set nocp
1776 bwipe 1772 bwipe
1777 au! 1773 au!
1778 endfunc 1774 endfunc
1779 1775
1780 func Test_nocatch_wipe_dummy_buffer() 1776 func Test_nocatch_wipe_dummy_buffer()
1781 if has('quickfix') 1777 CheckFeature quickfix
1782 " Nasty autocommand: wipe buffer on any event. 1778 " Nasty autocommand: wipe buffer on any event.
1783 au * x bwipe 1779 au * x bwipe
1784 call assert_fails('lv½ /x', 'E937') 1780 call assert_fails('lv½ /x', 'E937')
1785 au! 1781 au!
1786 endif
1787 endfunc 1782 endfunc
1788 1783
1789 function s:Before_test_dirchanged() 1784 function s:Before_test_dirchanged()
1790 augroup test_dirchanged 1785 augroup test_dirchanged
1791 autocmd! 1786 autocmd!
1832 call assert_equal(["lcd:", s:dir_bar], s:li) 1827 call assert_equal(["lcd:", s:dir_bar], s:li)
1833 call s:After_test_dirchanged() 1828 call s:After_test_dirchanged()
1834 endfunc 1829 endfunc
1835 1830
1836 function Test_dirchanged_auto() 1831 function Test_dirchanged_auto()
1837 if !exists('+autochdir') 1832 CheckOption autochdir
1838 return
1839 endif
1840 call s:Before_test_dirchanged() 1833 call s:Before_test_dirchanged()
1841 call test_autochdir() 1834 call test_autochdir()
1842 autocmd test_dirchanged DirChanged auto call add(s:li, "auto:") 1835 autocmd test_dirchanged DirChanged auto call add(s:li, "auto:")
1843 autocmd test_dirchanged DirChanged auto call add(s:li, expand("<afile>")) 1836 autocmd test_dirchanged DirChanged auto call add(s:li, expand("<afile>"))
1844 set acd 1837 set acd
2085 " - FilterReadPost substituting characters after filtering 2078 " - FilterReadPost substituting characters after filtering
2086 " - FileReadPre set options for decompression 2079 " - FileReadPre set options for decompression
2087 " - FileReadPost decompress the file 2080 " - FileReadPost decompress the file
2088 func Test_ReadWrite_Autocmds() 2081 func Test_ReadWrite_Autocmds()
2089 " Run this test only on Unix-like systems and if gzip is available 2082 " Run this test only on Unix-like systems and if gzip is available
2090 if !has('unix') || !executable("gzip") 2083 CheckUnix
2091 return 2084 CheckExecutable gzip
2092 endif
2093 2085
2094 " Make $GZIP empty, "-v" would cause trouble. 2086 " Make $GZIP empty, "-v" would cause trouble.
2095 let $GZIP = "" 2087 let $GZIP = ""
2096 2088
2097 " Use a FileChangedShell autocommand to avoid a prompt for 'Xtestfile.gz' 2089 " Use a FileChangedShell autocommand to avoid a prompt for 'Xtestfile.gz'