summaryrefslogtreecommitdiffstats
path: root/src/testdir/shared.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-06 21:03:06 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-06 21:03:06 +0200
commitab5894638413748fcedfe28691e6c27893924520 (patch)
tree45318c835f879c4ff5f235f7774c37f5a6a9d359 /src/testdir/shared.vim
parent0ad3e894d75236915e67dfbbcc821b6bb3c05d91 (diff)
patch 8.2.1146: not enough testing for Pythonv8.2.1146
Problem: Not enough testing for Python. Solution: Add more tests. Fix uncovered problems. (Yegappan Lakshmanan, closes #6392)
Diffstat (limited to 'src/testdir/shared.vim')
-rw-r--r--src/testdir/shared.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim
index 3e0929c349..bbd28be1cc 100644
--- a/src/testdir/shared.vim
+++ b/src/testdir/shared.vim
@@ -353,4 +353,19 @@ func GetMessages()
return msg_list
endfunc
+" Run the list of commands in 'cmds' and look for 'errstr' in exception.
+" Note that assert_fails() cannot be used in some places and this function
+" can be used.
+func AssertException(cmds, errstr)
+ let save_exception = ''
+ try
+ for cmd in a:cmds
+ exe cmd
+ endfor
+ catch
+ let save_exception = v:exception
+ endtry
+ call assert_match(a:errstr, save_exception)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab