0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 9.0.1185: using class from imported script not tested

Problem:    Using class from imported script not tested.
Solution:   Add tests.  Implement what is missing.
This commit is contained in:
Bram Moolenaar
2023-01-12 17:06:27 +00:00
parent a94bd9d939
commit a86655af84
6 changed files with 64 additions and 7 deletions

View File

@@ -974,5 +974,27 @@ def Test_class_extends()
v9.CheckScriptSuccess(lines)
enddef
def Test_class_import()
var lines =<< trim END
vim9script
export class Animal
this.kind: string
this.name: string
endclass
END
writefile(lines, 'Xanimal.vim', 'D')
lines =<< trim END
vim9script
import './Xanimal.vim' as animal
var a: animal.Animal
a = animal.Animal.new('fish', 'Eric')
assert_equal('fish', a.kind)
assert_equal('Eric', a.name)
END
v9.CheckScriptSuccess(lines)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker