diff options
author | Ernie Rael <errael@raelity.com> | 2024-04-17 22:36:32 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-04-17 22:39:34 +0200 |
commit | 1433ac93eb3acf28c55f0c4d775716ebee543160 (patch) | |
tree | aa06e6e72837313f17b6321412bee6518f6a4bb8 /src/testdir | |
parent | a34ba821076476a68e0e579723d68e896f771ba6 (diff) |
patch 9.1.0346: Patch v9.1.0338 fixed sourcing a script with importv9.1.0346
Problem: Patch v9.1.0338 fixed sourcing a script with import
Solution: Add test `import './file.vim' and verify it works with `:source`
so it does not regress (Ernie Rael)
closes: #14577
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_import.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_import.vim b/src/testdir/test_vim9_import.vim index 156b035d48..968bce08b9 100644 --- a/src/testdir/test_vim9_import.vim +++ b/src/testdir/test_vim9_import.vim @@ -1140,6 +1140,31 @@ def Test_autoload_import_relative() v9.CheckScriptFailure(lines, 'E484:') enddef +def Test_autoload_import_relative_compiled() + # autoload relative, access from compiled function. #14565 + var lines =<< trim END + vim9script + + export def F1(): string + return 'InFile.vim' + enddef + END + writefile(lines, 'xfile.vim', 'D') + lines =<< trim END + vim9script + + import autoload './xfile.vim' + + def F(): string + return xfile.F1() + enddef + assert_equal('InFile.vim', F()) + END + new + setline(1, lines) + :source +enddef + def Test_autoload_import_relative_autoload_dir() mkdir('autoload', 'pR') var lines =<< trim END |