mirror of
https://github.com/vim/vim.git
synced 2025-10-02 05:04:20 -04:00
patch 8.2.2554: Vim9: exporting a final is not tested
Problem: Vim9: exporting a final is not tested. Solution: Add a test.
This commit is contained in:
@@ -918,6 +918,7 @@ let s:export_script_lines =<< trim END
|
|||||||
export def Exported(): string
|
export def Exported(): string
|
||||||
return 'Exported'
|
return 'Exported'
|
||||||
enddef
|
enddef
|
||||||
|
export final theList = [1]
|
||||||
END
|
END
|
||||||
|
|
||||||
def Undo_export_script_lines()
|
def Undo_export_script_lines()
|
||||||
@@ -945,6 +946,10 @@ def Test_vim9_import_export()
|
|||||||
exp_name ..= ' Doe'
|
exp_name ..= ' Doe'
|
||||||
g:imported_name_appended = exp_name
|
g:imported_name_appended = exp_name
|
||||||
g:imported_later = exported
|
g:imported_later = exported
|
||||||
|
|
||||||
|
import theList from './Xexport.vim'
|
||||||
|
theList->add(2)
|
||||||
|
assert_equal([1, 2], theList)
|
||||||
END
|
END
|
||||||
|
|
||||||
writefile(import_script_lines, 'Ximport.vim')
|
writefile(import_script_lines, 'Ximport.vim')
|
||||||
@@ -1144,6 +1149,18 @@ def Test_vim9_import_export()
|
|||||||
writefile(import_assign_to_const, 'Ximport.vim')
|
writefile(import_assign_to_const, 'Ximport.vim')
|
||||||
assert_fails('source Ximport.vim', 'E46:', '', 1, '_Assign')
|
assert_fails('source Ximport.vim', 'E46:', '', 1, '_Assign')
|
||||||
|
|
||||||
|
# try changing an imported final
|
||||||
|
var import_assign_to_final =<< trim END
|
||||||
|
vim9script
|
||||||
|
import theList from './Xexport.vim'
|
||||||
|
def Assign()
|
||||||
|
theList = [2]
|
||||||
|
enddef
|
||||||
|
defcompile
|
||||||
|
END
|
||||||
|
writefile(import_assign_to_final, 'Ximport.vim')
|
||||||
|
assert_fails('source Ximport.vim', 'E46:', '', 1, '_Assign')
|
||||||
|
|
||||||
# import a very long name, requires making a copy
|
# import a very long name, requires making a copy
|
||||||
var import_long_name_lines =<< trim END
|
var import_long_name_lines =<< trim END
|
||||||
vim9script
|
vim9script
|
||||||
|
@@ -750,6 +750,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 */
|
||||||
|
/**/
|
||||||
|
2554,
|
||||||
/**/
|
/**/
|
||||||
2553,
|
2553,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user