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.
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index b9f3f7b..b2fc968 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -279,39 +279,19 @@
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