diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-05 12:56:44 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-05 12:56:44 +0000 |
commit | 204852ae2adfdde10c656ca7f14e5b4207a69172 (patch) | |
tree | 67b62ce1a926faaeff341efa797baa3da5fd2326 /src/testdir/test_vim9_script.vim | |
parent | e1d1211799bc37c063666e97437cf4e9af4782b0 (diff) |
patch 8.2.4510: Vim9: shortening commands leads to confusing scriptv8.2.4510
Problem: Vim9: shortening commands leads to confusing script.
Solution: In Vim9 script require at least ":cont" for ":continue", "const"
instead of "cons", "break" instead of "brea", "catch" instead of
"cat", "else" instead of "el" "elseif" instead of "elsei" "endfor"
instead of "endfo" "endif" instead of "en" "endtry" instead of
"endt", "finally" instead of "fina", "throw" instead of "th",
"while" instead of "wh".
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index f60fb36bc3..a503d113ef 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -460,7 +460,7 @@ def Test_try_catch_throw() endtry catch /wrong/ add(l, 'caught') - fina + finally add(l, 'finally') endtry assert_equal(['1', 'caught', 'finally'], l) @@ -1004,7 +1004,7 @@ enddef def s:ReturnFinally(): string try return 'intry' - finall + finally g:in_finally = 'finally' endtry return 'end' @@ -3374,6 +3374,37 @@ def Run_test_reject_declaration() g:StopVimInTerminal(buf) enddef +def Test_minimal_command_name_length() + var names = [ + 'cons', + 'brea', + 'cat', + 'catc', + 'con', + 'el', + 'els', + 'elsei', + 'endfo', + 'en', + 'end', + 'endi', + 'endw', + 'endt', + 'endtr', + 'fina', + 'finall', + 'th', + 'thr', + 'thro', + 'wh', + 'whi', + 'whil', + ] + for name in names + v9.CheckDefAndScriptFailure([name .. ' '], 'E1065:') + endfor +enddef + def Test_unset_any_variable() var lines =<< trim END var name: any |