comparison src/testdir/runtest.vim @ 15377:88b0a490816e

patch 8.1.0696: when test_edit fails 'insertmode' may not be reset commit https://github.com/vim/vim/commit/8ad16da7290190f55f88073d5586dfe133fddf45 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 6 15:29:57 2019 +0100 patch 8.1.0696: when test_edit fails 'insertmode' may not be reset Problem: When test_edit fails 'insertmode' may not be reset and the next test may get stuck. (James McCoy) Solution: Always reset 'insertmode' after executing a test. Avoid that an InsertCharPre autocommand or a 'complete' function can change the state. (closes #3768)
author Bram Moolenaar <Bram@vim.org>
date Sun, 06 Jan 2019 15:30:06 +0100
parents 52e883259d99
children 2dcaa860e3fc
comparison
equal deleted inserted replaced
15376:e2a7a22c6b53 15377:88b0a490816e
24 " 24 "
25 " If cleanup after each Test_ function is needed, define a TearDown function. 25 " If cleanup after each Test_ function is needed, define a TearDown function.
26 " It will be called after each Test_ function. 26 " It will be called after each Test_ function.
27 " 27 "
28 " When debugging a test it can be useful to add messages to v:errors: 28 " When debugging a test it can be useful to add messages to v:errors:
29 " call add(v:errors, "this happened") 29 " call add(v:errors, "this happened")
30 30
31 31
32 " Without the +eval feature we can't run these tests, bail out. 32 " Without the +eval feature we can't run these tests, bail out.
33 so small.vim 33 so small.vim
34 34
146 call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', '')) 146 call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', ''))
147 catch 147 catch
148 call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) 148 call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
149 endtry 149 endtry
150 endif 150 endif
151
152 " In case 'insertmode' was set and something went wrong, make sure it is
153 " reset to avoid trouble with anything else.
154 set noinsertmode
151 155
152 if exists("*TearDown") 156 if exists("*TearDown")
153 try 157 try
154 call TearDown() 158 call TearDown()
155 catch 159 catch