diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-12-07 22:11:27 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-12-07 22:11:27 +0100 |
commit | 6e65d594aa33be11f6074f26e9ff81b52504c62b (patch) | |
tree | a3c542e974c6c576792e6b3c7541907926e1b445 /src/testdir | |
parent | 23c1b2b018c8121ca5fcc247e37966428bf8ca66 (diff) |
patch 8.0.1377: cannot call a dict function in autoloaded dictv8.0.1377
Problem: Cannot call a dict function in autoloaded dict.
Solution: Call get_lval() passing the read-only flag.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/Make_all.mak | 1 | ||||
-rw-r--r-- | src/testdir/sautest/autoload/foo.vim | 7 | ||||
-rw-r--r-- | src/testdir/sautest/autoload/globone.vim | 1 | ||||
-rw-r--r-- | src/testdir/sautest/autoload/globtwo.vim | 1 | ||||
-rw-r--r-- | src/testdir/test_autoload.vim | 11 | ||||
-rw-r--r-- | src/testdir/test_escaped_glob.vim | 8 |
6 files changed, 25 insertions, 4 deletions
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index df79e9ab9a..5d5fccf109 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -73,6 +73,7 @@ NEW_TESTS = test_arabic.res \ test_assert.res \ test_autochdir.res \ test_autocmd.res \ + test_autoload.res \ test_backspace_opt.res \ test_breakindent.res \ test_bufwintabinfo.res \ diff --git a/src/testdir/sautest/autoload/foo.vim b/src/testdir/sautest/autoload/foo.vim new file mode 100644 index 0000000000..d7dcd5ce3d --- /dev/null +++ b/src/testdir/sautest/autoload/foo.vim @@ -0,0 +1,7 @@ +let g:loaded_foo_vim += 1 + +let foo#bar = {} + +func foo#bar.echo() + let g:called_foo_bar_echo += 1 +endfunc diff --git a/src/testdir/sautest/autoload/globone.vim b/src/testdir/sautest/autoload/globone.vim new file mode 100644 index 0000000000..98c9a10582 --- /dev/null +++ b/src/testdir/sautest/autoload/globone.vim @@ -0,0 +1 @@ +" used by Test_globpath() diff --git a/src/testdir/sautest/autoload/globtwo.vim b/src/testdir/sautest/autoload/globtwo.vim new file mode 100644 index 0000000000..98c9a10582 --- /dev/null +++ b/src/testdir/sautest/autoload/globtwo.vim @@ -0,0 +1 @@ +" used by Test_globpath() diff --git a/src/testdir/test_autoload.vim b/src/testdir/test_autoload.vim new file mode 100644 index 0000000000..a92851f655 --- /dev/null +++ b/src/testdir/test_autoload.vim @@ -0,0 +1,11 @@ +" 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) +endfunc diff --git a/src/testdir/test_escaped_glob.vim b/src/testdir/test_escaped_glob.vim index b91c6e7424..e0723da6f0 100644 --- a/src/testdir/test_escaped_glob.vim +++ b/src/testdir/test_escaped_glob.vim @@ -25,8 +25,8 @@ function Test_glob() endfunction function Test_globpath() - call assert_equal("sautest/autoload/Test104.vim\nsautest/autoload/footest.vim", - \ globpath('sautest/autoload', '*.vim')) - call assert_equal(['sautest/autoload/Test104.vim', 'sautest/autoload/footest.vim'], - \ globpath('sautest/autoload', '*.vim', 0, 1)) + call assert_equal("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim", + \ globpath('sautest/autoload', 'glob*.vim')) + call assert_equal(['sautest/autoload/globone.vim', 'sautest/autoload/globtwo.vim'], + \ globpath('sautest/autoload', 'glob*.vim', 0, 1)) endfunction |