annotate src/testdir/test_autoload.vim @ 35176:bbbd250e3d7a default tip

runtime(i3config/swayconfig): allow indented commands (#14757) Commit: https://github.com/vim/vim/commit/679f5abb9930fafda29ae038f47de357e9a0f53e Author: Josef Lito? <54900518+JosefLitos@users.noreply.github.com> Date: Mon May 13 22:03:42 2024 +0200 runtime(i3config/swayconfig): allow indented commands (https://github.com/vim/vim/issues/14757) fixes: https://github.com/vim/vim/issues/14752 Co-authored-by: jamespeapen <jamespeapen@users.noreply.github.com> Signed-off-by: Josef Lito? <54900518+JosefLitos@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 13 May 2024 22:15:04 +0200
parents 307341b9c227
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13002
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for autoload
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 set runtimepath=./sautest
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4
13004
41e46caf1030 patch 8.0.1378: autoload script sources itself when defining function
Christian Brabandt <cb@256bit.org>
parents: 13002
diff changeset
5 func Test_autoload_dict_func()
13002
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 let g:loaded_foo_vim = 0
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 let g:called_foo_bar_echo = 0
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 call g:foo#bar.echo()
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 call assert_equal(1, g:loaded_foo_vim)
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 call assert_equal(1, g:called_foo_bar_echo)
17638
9ffec4eb8d33 patch 8.1.1816: cannot use a user defined function as a method
Bram Moolenaar <Bram@vim.org>
parents: 13004
diff changeset
11
9ffec4eb8d33 patch 8.1.1816: cannot use a user defined function as a method
Bram Moolenaar <Bram@vim.org>
parents: 13004
diff changeset
12 eval 'bar'->g:foo#addFoo()->assert_equal('barfoo')
27279
6e1b0c4ab668 patch 8.2.4168: disallowing empty function name breaks existing plugins
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
13
6e1b0c4ab668 patch 8.2.4168: disallowing empty function name breaks existing plugins
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
14 " empty name works in legacy script
6e1b0c4ab668 patch 8.2.4168: disallowing empty function name breaks existing plugins
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
15 call assert_equal('empty', foo#())
13002
f7b2ecaeb79c patch 8.0.1377: cannot call a dict function in autoloaded dict
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 endfunc
13004
41e46caf1030 patch 8.0.1378: autoload script sources itself when defining function
Christian Brabandt <cb@256bit.org>
parents: 13002
diff changeset
17
41e46caf1030 patch 8.0.1378: autoload script sources itself when defining function
Christian Brabandt <cb@256bit.org>
parents: 13002
diff changeset
18 func Test_source_autoload()
41e46caf1030 patch 8.0.1378: autoload script sources itself when defining function
Christian Brabandt <cb@256bit.org>
parents: 13002
diff changeset
19 let g:loaded_sourced_vim = 0
41e46caf1030 patch 8.0.1378: autoload script sources itself when defining function
Christian Brabandt <cb@256bit.org>
parents: 13002
diff changeset
20 source sautest/autoload/sourced.vim
41e46caf1030 patch 8.0.1378: autoload script sources itself when defining function
Christian Brabandt <cb@256bit.org>
parents: 13002
diff changeset
21 call assert_equal(1, g:loaded_sourced_vim)
41e46caf1030 patch 8.0.1378: autoload script sources itself when defining function
Christian Brabandt <cb@256bit.org>
parents: 13002
diff changeset
22 endfunc
21550
b0b57d91671c patch 8.2.1325: Vim9: using Vim9 script for autaload not tested
Bram Moolenaar <Bram@vim.org>
parents: 17638
diff changeset
23
b0b57d91671c patch 8.2.1325: Vim9: using Vim9 script for autaload not tested
Bram Moolenaar <Bram@vim.org>
parents: 17638
diff changeset
24 func Test_autoload_vim9script()
27474
307341b9c227 patch 8.2.4265: autoload tests fails
Bram Moolenaar <Bram@vim.org>
parents: 27279
diff changeset
25 call assert_equal('some', auto9#Getsome())
307341b9c227 patch 8.2.4265: autoload tests fails
Bram Moolenaar <Bram@vim.org>
parents: 27279
diff changeset
26 call assert_equal(49, auto9#Add42(7))
21550
b0b57d91671c patch 8.2.1325: Vim9: using Vim9 script for autaload not tested
Bram Moolenaar <Bram@vim.org>
parents: 17638
diff changeset
27 endfunc
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21550
diff changeset
28
27279
6e1b0c4ab668 patch 8.2.4168: disallowing empty function name breaks existing plugins
Bram Moolenaar <Bram@vim.org>
parents: 21765
diff changeset
29
21765
08940efa6b4e patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents: 21550
diff changeset
30 " vim: shiftwidth=2 sts=2 expandtab