summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_script.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-16 20:01:39 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-16 20:01:39 +0000
commit4c8b546da2059865e20902586bb3e0ff07c279a0 (patch)
tree48f6530068bd15448802dbd076b155ce8b9c8e1f /src/testdir/test_vim9_script.vim
parentd597ab00d799aa078be32e6677e01a7582106105 (diff)
patch 8.2.4582: useless code handling a type declarationv8.2.4582
Problem: Useless code handling a type declaration. Solution: Remove the code and give an error.
Diffstat (limited to 'src/testdir/test_vim9_script.vim')
-rw-r--r--src/testdir/test_vim9_script.vim30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index ec0d54797f..3ad9c9d4f5 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -3942,10 +3942,6 @@ def Test_profile_with_lambda()
enddef
def Profile()
- profile start Xprofile.log
- profile func ProfiledWithLambda
- # mark ProfiledNested for profiling to avoid E1271
- profile func ProfiledNested
ProfiledWithLambda()
ProfiledNested()
@@ -3957,8 +3953,20 @@ def Test_profile_with_lambda()
profdel func *
profile pause
enddef
- Profile()
- writefile(['done'], 'Xdidprofile')
+
+ var result = 'done'
+ try
+ # mark functions for profiling now to avoid E1271
+ profile start Xprofile.log
+ profile func ProfiledWithLambda
+ profile func ProfiledNested
+
+ Profile()
+ catch
+ result = 'failed: ' .. v:exception
+ finally
+ writefile([result], 'Xdidprofile')
+ endtry
END
writefile(lines, 'Xprofile.vim')
call system(g:GetVimCommand()
@@ -3974,6 +3982,16 @@ def Test_profile_with_lambda()
delete('Xprofile.vim')
enddef
+def Test_misplaced_type()
+ writefile(['let g:somevar = "asdf"'], 'XTest_misplaced_type')
+ var buf = g:RunVimInTerminal('-S XTest_misplaced_type', {'rows': 6})
+ term_sendkeys(buf, ":vim9cmd echo islocked('g:somevar: string')\<CR>")
+ g:VerifyScreenDump(buf, 'Test_misplaced_type', {})
+
+ g:StopVimInTerminal(buf)
+ delete('XTest_misplaced_type')
+enddef
+
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new