comparison src/testdir/test_vim9_expr.vim @ 21753:9ef7ae8ab51c v8.2.1426

patch 8.2.1426: Vim9: cannot call autoload function in :def function Commit: https://github.com/vim/vim/commit/a177344dc0c337e5b272c1c59d13964a8318bcfa Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 12 15:21:22 2020 +0200 patch 8.2.1426: Vim9: cannot call autoload function in :def function Problem: Vim9: cannot call autoload function in :def function. Solution: Load the autoload script. (closes https://github.com/vim/vim/issues/6690)
author Bram Moolenaar <Bram@vim.org>
date Wed, 12 Aug 2020 15:30:04 +0200
parents caf0286cf02b
children 25b659fa5ca5
comparison
equal deleted inserted replaced
21752:6b6f91a7959d 21753:9ef7ae8ab51c
1750 call CheckDefFailure(["let x = 'yes'->Echo"], 'E107:') 1750 call CheckDefFailure(["let x = 'yes'->Echo"], 'E107:')
1751 call CheckScriptFailure([ 1751 call CheckScriptFailure([
1752 "vim9script", 1752 "vim9script",
1753 "let x = substitute ('x', 'x', 'x', 'x')" 1753 "let x = substitute ('x', 'x', 'x', 'x')"
1754 ], 'E121:') 1754 ], 'E121:')
1755
1756 let auto_lines =<< trim END
1757 def g:some#func(): string
1758 return 'found'
1759 enddef
1760 END
1761 mkdir('Xruntime/autoload', 'p')
1762 writefile(auto_lines, 'Xruntime/autoload/some.vim')
1763 let save_rtp = &rtp
1764 &rtp = getcwd() .. '/Xruntime,' .. &rtp
1765 assert_equal('found', g:some#func())
1766 assert_equal('found', some#func())
1767
1768 &rtp = save_rtp
1769 delete('Xruntime', 'rf')
1755 enddef 1770 enddef
1756 1771
1757 1772
1758 def Test_expr7_not() 1773 def Test_expr7_not()
1759 let lines =<< trim END 1774 let lines =<< trim END