Mercurial > vim
changeset 22264:e0a4d029cb87 v8.2.1681
patch 8.2.1681: Vim9: unnessary :call commands in tests
Commit: https://github.com/vim/vim/commit/08052228a72074cdb0165e65f01b2fa8fce867ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 14 17:04:31 2020 +0200
patch 8.2.1681: Vim9: unnessary :call commands in tests
Problem: Vim9: unnessary :call commands in tests.
Solution: Remove the commands. (issue https://github.com/vim/vim/issues/6936)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 14 Sep 2020 17:15:04 +0200 |
parents | 8a31402b1f81 |
children | 2156b72e9b6b |
files | src/testdir/test_vim9_func.vim src/testdir/test_vim9_script.vim src/version.c |
diffstat | 3 files changed, 48 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -279,7 +279,7 @@ def Test_call_wrong_args() enddef Func([]) END - call CheckScriptFailure(lines, 'E1013: argument 1: type mismatch, expected string but got list<unknown>', 5) + CheckScriptFailure(lines, 'E1013: argument 1: type mismatch, expected string but got list<unknown>', 5) enddef " Default arg and varargs @@ -1099,7 +1099,7 @@ def Test_error_reporting() enddef defcompile END - call writefile(lines, 'Xdef') + writefile(lines, 'Xdef') try source Xdef assert_report('should have failed') @@ -1119,7 +1119,7 @@ def Test_error_reporting() enddef defcompile END - call writefile(lines, 'Xdef') + writefile(lines, 'Xdef') try source Xdef assert_report('should have failed') @@ -1138,7 +1138,7 @@ def Test_error_reporting() defcompile Func() END - call writefile(lines, 'Xdef') + writefile(lines, 'Xdef') try source Xdef assert_report('should have failed') @@ -1146,7 +1146,7 @@ def Test_error_reporting() v:throwpoint->assert_match('_Func, line 3$') endtry - call delete('Xdef') + delete('Xdef') enddef def Test_deleted_function()
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -319,7 +319,6 @@ def Test_assignment_list() list3 += ['end'] assert_equal(['sdf', 'asdf', 'end'], list3) - CheckDefExecFailure(['let ll = [1, 2, 3]', 'll[-4] = 6'], 'E684:') CheckDefExecFailure(['let [v1, v2] = [1, 2]'], 'E1092:') @@ -367,7 +366,7 @@ def Test_assignment_dict() enddef assert_equal(#{a: 43}, FillDict()) END - call CheckScriptSuccess(lines) + CheckScriptSuccess(lines) lines =<< trim END vim9script @@ -378,7 +377,7 @@ def Test_assignment_dict() enddef FillDict() END - call CheckScriptFailure(lines, 'E1103:') + CheckScriptFailure(lines, 'E1103:') # assignment to global dict lines =<< trim END @@ -390,7 +389,7 @@ def Test_assignment_dict() enddef assert_equal(#{a: 43}, FillDict()) END - call CheckScriptSuccess(lines) + CheckScriptSuccess(lines) # assignment to buffer dict lines =<< trim END @@ -402,7 +401,7 @@ def Test_assignment_dict() enddef assert_equal(#{a: 43}, FillDict()) END - call CheckScriptSuccess(lines) + CheckScriptSuccess(lines) enddef def Test_assignment_local() @@ -440,7 +439,7 @@ def Test_assignment_local() enddef call Test_assignment_local_internal() END - call CheckScriptSuccess(script_lines) + CheckScriptSuccess(script_lines) enddef def Test_assignment_default() @@ -794,37 +793,37 @@ def Test_delfunction() CheckScriptSuccess(lines) enddef -func Test_wrong_type() - call CheckDefFailure(['let var: list<nothing>'], 'E1010:') - call CheckDefFailure(['let var: list<list<nothing>>'], 'E1010:') - call CheckDefFailure(['let var: dict<nothing>'], 'E1010:') - call CheckDefFailure(['let var: dict<dict<nothing>>'], 'E1010:') - - call CheckDefFailure(['let var: dict<number'], 'E1009:') - call CheckDefFailure(['let var: dict<list<number>'], 'E1009:') - - call CheckDefFailure(['let var: ally'], 'E1010:') - call CheckDefFailure(['let var: bram'], 'E1010:') - call CheckDefFailure(['let var: cathy'], 'E1010:') - call CheckDefFailure(['let var: dom'], 'E1010:') - call CheckDefFailure(['let var: freddy'], 'E1010:') - call CheckDefFailure(['let var: john'], 'E1010:') - call CheckDefFailure(['let var: larry'], 'E1010:') - call CheckDefFailure(['let var: ned'], 'E1010:') - call CheckDefFailure(['let var: pam'], 'E1010:') - call CheckDefFailure(['let var: sam'], 'E1010:') - call CheckDefFailure(['let var: vim'], 'E1010:') - - call CheckDefFailure(['let Ref: number', 'Ref()'], 'E1085:') - call CheckDefFailure(['let Ref: string', 'let res = Ref()'], 'E1085:') -endfunc - -func Test_const() - call CheckDefFailure(['const var = 234', 'var = 99'], 'E1018:') - call CheckDefFailure(['const one = 234', 'let one = 99'], 'E1017:') - call CheckDefFailure(['const two'], 'E1021:') - call CheckDefFailure(['const &option'], 'E996:') -endfunc +def Test_wrong_type() + CheckDefFailure(['let var: list<nothing>'], 'E1010:') + CheckDefFailure(['let var: list<list<nothing>>'], 'E1010:') + CheckDefFailure(['let var: dict<nothing>'], 'E1010:') + CheckDefFailure(['let var: dict<dict<nothing>>'], 'E1010:') + + CheckDefFailure(['let var: dict<number'], 'E1009:') + CheckDefFailure(['let var: dict<list<number>'], 'E1009:') + + CheckDefFailure(['let var: ally'], 'E1010:') + CheckDefFailure(['let var: bram'], 'E1010:') + CheckDefFailure(['let var: cathy'], 'E1010:') + CheckDefFailure(['let var: dom'], 'E1010:') + CheckDefFailure(['let var: freddy'], 'E1010:') + CheckDefFailure(['let var: john'], 'E1010:') + CheckDefFailure(['let var: larry'], 'E1010:') + CheckDefFailure(['let var: ned'], 'E1010:') + CheckDefFailure(['let var: pam'], 'E1010:') + CheckDefFailure(['let var: sam'], 'E1010:') + CheckDefFailure(['let var: vim'], 'E1010:') + + CheckDefFailure(['let Ref: number', 'Ref()'], 'E1085:') + CheckDefFailure(['let Ref: string', 'let res = Ref()'], 'E1085:') +enddef + +def Test_const() + CheckDefFailure(['const var = 234', 'var = 99'], 'E1018:') + CheckDefFailure(['const one = 234', 'let one = 99'], 'E1017:') + CheckDefFailure(['const two'], 'E1021:') + CheckDefFailure(['const &option'], 'E996:') +enddef def Test_range_no_colon() CheckDefFailure(['%s/a/b/'], 'E1050:') @@ -844,11 +843,11 @@ def Test_block() assert_equal(1, outer) enddef -func Test_block_failure() - call CheckDefFailure(['{', 'let inner = 1', '}', 'echo inner'], 'E1001:') - call CheckDefFailure(['}'], 'E1025:') - call CheckDefFailure(['{', 'echo 1'], 'E1026:') -endfunc +def Test_block_failure() + CheckDefFailure(['{', 'let inner = 1', '}', 'echo inner'], 'E1001:') + CheckDefFailure(['}'], 'E1025:') + CheckDefFailure(['{', 'echo 1'], 'E1026:') +enddef func g:NoSuchFunc() echo 'none'