2018-09-09 14:50:48 -07:00
|
|
|
" Tests for autoload
|
|
|
|
|
|
|
|
set runtimepath=./sautest
|
|
|
|
|
2018-09-09 17:28:07 -07:00
|
|
|
func Test_autoload_dict_func()
|
2018-09-09 14:50:48 -07:00
|
|
|
let g:loaded_foo_vim = 0
|
|
|
|
let g:called_foo_bar_echo = 0
|
|
|
|
call g:foo#bar.echo()
|
|
|
|
call assert_equal(1, g:loaded_foo_vim)
|
|
|
|
call assert_equal(1, g:called_foo_bar_echo)
|
2021-08-06 10:31:27 -07:00
|
|
|
|
|
|
|
eval 'bar'->g:foo#addFoo()->assert_equal('barfoo')
|
2022-12-04 01:29:36 -07:00
|
|
|
|
|
|
|
" empty name works in legacy script
|
|
|
|
call assert_equal('empty', foo#())
|
2018-09-09 14:50:48 -07:00
|
|
|
endfunc
|
2018-09-09 17:28:07 -07:00
|
|
|
|
|
|
|
func Test_source_autoload()
|
|
|
|
let g:loaded_sourced_vim = 0
|
|
|
|
source sautest/autoload/sourced.vim
|
|
|
|
call assert_equal(1, g:loaded_sourced_vim)
|
|
|
|
endfunc
|
2022-12-04 01:29:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
" vim: shiftwidth=2 sts=2 expandtab
|