mirror of https://github.com/vim/vim.git
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:
parent
a34ba82107
commit
1433ac93eb
|
@ -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
|
||||
|
|
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
346,
|
||||
/**/
|
||||
345,
|
||||
/**/
|
||||
|
|
Loading…
Reference in New Issue