comparison src/testdir/test_vim9_import.vim @ 27076:ceff6a546748 v8.2.4067

patch 8.2.4067: Vim9: cannot call imported function with :call Commit: https://github.com/vim/vim/commit/f111cdfae6edf697390e0d9a85082a6526b03da6 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 12 12:48:17 2022 +0000 patch 8.2.4067: Vim9: cannot call imported function with :call Problem: Vim9: cannot call imported function with :call. (Drew Vogel) Solution: Translate the function name. (closes https://github.com/vim/vim/issues/9510)
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Jan 2022 14:00:06 +0100
parents 19fefc42a063
children 9897dd3c6530
comparison
equal deleted inserted replaced
27075:02bf1cf035da 27076:ceff6a546748
1183 call assert_equal('final', prefixed#fname) 1183 call assert_equal('final', prefixed#fname)
1184 call assert_equal('const', prefixed#cname) 1184 call assert_equal('const', prefixed#cname)
1185 END 1185 END
1186 CheckScriptSuccess(lines) 1186 CheckScriptSuccess(lines)
1187 1187
1188 unlet g:prefixed_loaded
1189 unlet g:expected_loaded
1190 delete('Xdir', 'rf')
1191 &rtp = save_rtp
1192 enddef
1193
1194 def Test_vim9script_autoload_call()
1195 mkdir('Xdir/autoload', 'p')
1196 var save_rtp = &rtp
1197 exe 'set rtp^=' .. getcwd() .. '/Xdir'
1198
1199 var lines =<< trim END
1200 vim9script autoload
1201
1202 export def Getother()
1203 g:result = 'other'
1204 enddef
1205 END
1206 writefile(lines, 'Xdir/autoload/other.vim')
1207
1208 lines =<< trim END
1209 vim9script
1210 import autoload 'other.vim'
1211 call other.Getother()
1212 assert_equal('other', g:result)
1213 END
1214 CheckScriptSuccess(lines)
1215
1216 unlet g:result
1188 delete('Xdir', 'rf') 1217 delete('Xdir', 'rf')
1189 &rtp = save_rtp 1218 &rtp = save_rtp
1190 enddef 1219 enddef
1191 1220
1192 def Test_autoload_mapping() 1221 def Test_autoload_mapping()