view src/testdir/test_autoload.vim @ 30886:74e64f3a54ef v9.0.0777

patch 9.0.0777: code is indented too much Commit: https://github.com/vim/vim/commit/3f0092c141824356b55b11cd3985baaf4df65334 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Oct 16 21:43:07 2022 +0100 patch 9.0.0777: code is indented too much Problem: Code is indented too much. Solution: Use an early return. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/11386)
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Oct 2022 22:45:02 +0200
parents 307341b9c227
children a786d0dab454
line wrap: on
line source

" Tests for autoload

set runtimepath=./sautest

func Test_autoload_dict_func()
  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)

  eval 'bar'->g:foo#addFoo()->assert_equal('barfoo')

  " empty name works in legacy script
  call assert_equal('empty', foo#())
endfunc

func Test_source_autoload()
  let g:loaded_sourced_vim = 0
  source sautest/autoload/sourced.vim
  call assert_equal(1, g:loaded_sourced_vim)
endfunc

func Test_autoload_vim9script()
  call assert_equal('some', auto9#Getsome())
  call assert_equal(49, auto9#Add42(7))
endfunc


" vim: shiftwidth=2 sts=2 expandtab