diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-04-24 21:33:20 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-24 21:33:20 +0100 |
commit | aac12daa61d9e84616771ec9242fd232f46786e6 (patch) | |
tree | 565662e4cac5fd719c5ef61ac483574c8ab163a8 /src/testdir/test_vim9_import.vim | |
parent | 659c240cf769925ff432b88df8719e7ace4629b0 (diff) |
patch 8.2.4821: crash when imported autoload script was deletedv8.2.4821
Problem: Crash when imported autoload script was deleted.
Solution: Initialize local variable. (closes #10274) Give a more meaningful
error message.
Diffstat (limited to 'src/testdir/test_vim9_import.vim')
-rw-r--r-- | src/testdir/test_vim9_import.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index 82fea6efe3..159e51b2fe 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -1137,6 +1137,25 @@ def Test_autoload_import_relative_autoload_dir() delete('autoload', 'rf') enddef +def Test_autoload_import_deleted() + var lines =<< trim END + vim9script + export const FOO = 1 + END + writefile(lines, 'Xa.vim') + + lines =<< trim END + vim9script + import autoload './Xa.vim' + + delete('Xa.vim') + var x = Xa.FOO + END + v9.CheckScriptFailure(lines, 'E484:') + + delete('Xdir', 'rf') +enddef + func Test_import_in_diffexpr() CheckExecutable diff |