Mercurial > vim
annotate src/testdir/test_autoload.vim @ 32816:939396a5711c v9.0.1722
patch 9.0.1722: wrong error messages when passing wrong types to count()
Commit: https://github.com/vim/vim/commit/4f389e7c0fe7dfeccfa512a72fa36f9028d57159
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Aug 17 22:10:40 2023 +0200
patch 9.0.1722: wrong error messages when passing wrong types to count()
Problem: wrong error messages when passing wrong types to count()
Solution: fix it
This fixes two problems:
1. When passing wrong type to {ic} argument of count(), two error
messages are given, the second of which is misleading.
2. When passing wrong type to {comp} argument of count(), the error
message doesn't mention that {comp} may be a String.
closes: #12825
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 17 Aug 2023 22:15:03 +0200 |
parents | 307341b9c227 |
children | a786d0dab454 |
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 |