diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-07-19 21:45:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-19 21:45:07 +0200 |
commit | 605793500b351ee92483d04b1e03fb8af30dd101 (patch) | |
tree | 67ed3b97f6d60812218761c3db5d9f8780382adc /src/testdir | |
parent | ac2cd2b08f0fd15e9c3759da043e9b28da80dca8 (diff) |
patch 8.2.3186: Vim9: not all failures for import testedv8.2.3186
Problem: Vim9: not all failures for import tested
Solution: Test more import failures
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_script.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 203c5c905a..037c36d29e 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1375,6 +1375,30 @@ def Test_vim9_import_export() writefile(import_missing_comma_lines, 'Ximport3.vim') assert_fails('source Ximport3.vim', 'E1046:', '', 2, 'Ximport3.vim') + var import_redefining_lines =<< trim END + vim9script + import exported from './Xexport.vim' + var exported = 5 + END + writefile(import_redefining_lines, 'Ximport.vim') + assert_fails('source Ximport.vim', 'E1213: Redefining imported item "exported"', '', 3) + + var import_assign_wrong_type_lines =<< trim END + vim9script + import exported from './Xexport.vim' + exported = 'xxx' + END + writefile(import_assign_wrong_type_lines, 'Ximport.vim') + assert_fails('source Ximport.vim', 'E1012: Type mismatch; expected number but got string', '', 3) + + var import_assign_const_lines =<< trim END + vim9script + import CONST from './Xexport.vim' + CONST = 4321 + END + writefile(import_assign_const_lines, 'Ximport.vim') + assert_fails('source Ximport.vim', 'E741: Value is locked: CONST', '', 3) + delete('Ximport.vim') delete('Ximport3.vim') delete('Xexport.vim') |