0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.1.0346: Patch v9.1.0338 fixed sourcing a script with import

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>
This commit is contained in:
Ernie Rael
2024-04-17 22:36:32 +02:00
committed by Christian Brabandt
parent a34ba82107
commit 1433ac93eb
2 changed files with 27 additions and 0 deletions

View File

@@ -1140,6 +1140,31 @@ def Test_autoload_import_relative()
v9.CheckScriptFailure(lines, 'E484:') v9.CheckScriptFailure(lines, 'E484:')
enddef 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() def Test_autoload_import_relative_autoload_dir()
mkdir('autoload', 'pR') mkdir('autoload', 'pR')
var lines =<< trim END var lines =<< trim END

View File

@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
346,
/**/ /**/
345, 345,
/**/ /**/