diff src/testdir/test_quickfix.vim @ 7593:87e607fb6853 v7.4.1096

commit https://github.com/vim/vim/commit/a260b87d9da17f605666630f18c1ed909c2b8bae Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 15 20:48:22 2016 +0100 patch 7.4.1096 Problem: Need several lines to verify a command produces an error. Solution: Add assert_fails(). (suggested by Nikolay Pavlov) Make the quickfix alloc test actually work.
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Jan 2016 21:00:06 +0100
parents 4c922651fd78
children 85a7a945fb87
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -279,39 +279,19 @@ endfunction
 
 function Test_nomem()
   call alloc_fail(GetAllocId('qf_dirname_start'), 0, 0)
-  try
-    vimgrep vim runtest.vim
-  catch
-    call assert_true(v:exception =~ 'E342')
-  endtry
+  call assert_fails('vimgrep vim runtest.vim', 'E342:')
 
   call alloc_fail(GetAllocId('qf_dirname_now'), 0, 0)
-  try
-    vimgrep vim runtest.vim
-  catch
-    call assert_true(v:exception =~ 'E342')
-  endtry
+  call assert_fails('vimgrep vim runtest.vim', 'E342:')
 
   call alloc_fail(GetAllocId('qf_namebuf'), 0, 0)
-  try
-    cfile runtest.vim
-  catch
-    call assert_true(v:exception =~ 'E342')
-  endtry
+  call assert_fails('cfile runtest.vim', 'E342:')
 
   call alloc_fail(GetAllocId('qf_errmsg'), 0, 0)
-  try
-    cfile runtest.vim
-  catch
-    call assert_true(v:exception =~ 'E342')
-  endtry
+  call assert_fails('cfile runtest.vim', 'E342:')
 
   call alloc_fail(GetAllocId('qf_pattern'), 0, 0)
-  try
-    cfile runtest.vim
-  catch
-    call assert_true(v:exception =~ 'E342')
-  endtry
+  call assert_fails('cfile runtest.vim', 'E342:')
 
 endfunc