vim-patch:8.0.0478

Problem:    Tests use assert_true(0) and assert_false(1) to report errors.
Solution:   Use assert_report().

37175409d7
This commit is contained in:
James McCoy
2017-06-05 23:41:46 -04:00
parent dafc14b969
commit d707b2a171
6 changed files with 15 additions and 11 deletions

View File

@@ -28,7 +28,7 @@ func Test_cscopeWithCscopeConnections()
cscope add Xcscope.out
set cscopeverbose
catch
call assert_true(0)
call assert_report('exception thrown')
endtry
call assert_fails('cscope add', 'E560')
call assert_fails('cscope add Xcscope.out', 'E568')

View File

@@ -1,13 +1,7 @@
" Tests for cursor().
func Test_wrong_arguments()
try
call cursor(1. 3)
" not reached
call assert_false(1)
catch
call assert_exception('E474:')
endtry
call assert_fails('call cursor(1. 3)', 'E474:')
endfunc
func Test_move_cursor()

View File

@@ -78,7 +78,7 @@ endfunc
func Test_loop_over_null_list()
let null_list = submatch(1, 1)
for i in null_list
call assert_true(0, 'should not get here')
call assert_report('should not get here')
endfor
endfunc

View File

@@ -4,6 +4,6 @@ func Test_load_menu()
try
source $VIMRUNTIME/menu.vim
catch
call assert_false(1, 'error while loading menus: ' . v:exception)
call assert_report('error while loading menus: ' . v:exception)
endtry
endfunc

View File

@@ -533,7 +533,7 @@ func Test_completion_comment_formatting()
%d
try
call feedkeys("o/*\<cr>\<cr>\<c-x>\<c-u>/\<esc>", 'tx')
call assert_false(1, 'completefunc not set, should have failed')
call assert_report('completefunc not set, should have failed')
catch
call assert_exception('E764:')
endtry