diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-20 21:14:15 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-20 21:14:15 +0000 |
commit | 397a87ac1c9857eb0d5ec3add69e3b9ab6b0c77c (patch) | |
tree | 63860de699019af670a438af1145ff9bda9e795c /src/testdir/test_vim9_expr.vim | |
parent | efd73ae5d2a533670f562b6df5be2ffeb091185d (diff) |
patch 8.2.4602: Vim9: not enough test coverage for executing :def functionv8.2.4602
Problem: Vim9: not enough test coverage for executing :def function.
Solution: Add a few more tests. Fix uncovered problem. Remove dead code.
Diffstat (limited to 'src/testdir/test_vim9_expr.vim')
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index 02ea54ada6..dcce616de1 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -3312,6 +3312,29 @@ def Test_expr8_call_global() v9.CheckDefAndScriptFailure(lines, 'E117: Unknown function: ExistingGlobal') enddef +def Test_expr8_autoload_var() + var auto_lines =<< trim END + let autofile#var = 'found' + END + mkdir('Xruntime/autoload', 'p') + writefile(auto_lines, 'Xruntime/autoload/autofile.vim') + var save_rtp = &rtp + &rtp = getcwd() .. '/Xruntime,' .. &rtp + + var lines =<< trim END + assert_equal('found', autofile#var) + END + v9.CheckDefAndScriptSuccess(lines) + + lines =<< trim END + echo autofile#other + END + v9.CheckDefExecAndScriptFailure(lines, 'E121: Undefined variable: autofile#other') + + &rtp = save_rtp + delete('Xruntime', 'rf') +enddef + def Test_expr8_call_autoload() var auto_lines =<< trim END def g:some#func(): string |