diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-09-11 08:33:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-11 08:33:21 +0200 |
| commit | 036051b218760c6c8ff70b2ff347916acab993ff (patch) | |
| tree | ae2968ec2ccbba182e889a05c0ea3f9ee4b1fa07 /src/nvim/testdir | |
| parent | 77628d90a42076982e4c659f252b9b7b19698f5d (diff) | |
| parent | 39ab7cc6fb5948542f4ccc1d4067fdcca5183964 (diff) | |
| download | rneovim-036051b218760c6c8ff70b2ff347916acab993ff.tar.gz rneovim-036051b218760c6c8ff70b2ff347916acab993ff.tar.bz2 rneovim-036051b218760c6c8ff70b2ff347916acab993ff.zip | |
Merge pull request #8974 from janlazo/vim-8.0.1377
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/sautest/autoload/foo.vim | 7 | ||||
| -rw-r--r-- | src/nvim/testdir/sautest/autoload/globone.vim | 1 | ||||
| -rw-r--r-- | src/nvim/testdir/sautest/autoload/globtwo.vim | 1 | ||||
| -rw-r--r-- | src/nvim/testdir/sautest/autoload/sourced.vim | 3 | ||||
| -rw-r--r-- | src/nvim/testdir/test_autoload.vim | 17 | ||||
| -rw-r--r-- | src/nvim/testdir/test_escaped_glob.vim | 10 |
6 files changed, 34 insertions, 5 deletions
diff --git a/src/nvim/testdir/sautest/autoload/foo.vim b/src/nvim/testdir/sautest/autoload/foo.vim new file mode 100644 index 0000000000..d7dcd5ce3d --- /dev/null +++ b/src/nvim/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/nvim/testdir/sautest/autoload/globone.vim b/src/nvim/testdir/sautest/autoload/globone.vim new file mode 100644 index 0000000000..98c9a10582 --- /dev/null +++ b/src/nvim/testdir/sautest/autoload/globone.vim @@ -0,0 +1 @@ +" used by Test_globpath() diff --git a/src/nvim/testdir/sautest/autoload/globtwo.vim b/src/nvim/testdir/sautest/autoload/globtwo.vim new file mode 100644 index 0000000000..98c9a10582 --- /dev/null +++ b/src/nvim/testdir/sautest/autoload/globtwo.vim @@ -0,0 +1 @@ +" used by Test_globpath() diff --git a/src/nvim/testdir/sautest/autoload/sourced.vim b/src/nvim/testdir/sautest/autoload/sourced.vim new file mode 100644 index 0000000000..f69f00cb53 --- /dev/null +++ b/src/nvim/testdir/sautest/autoload/sourced.vim @@ -0,0 +1,3 @@ +let g:loaded_sourced_vim += 1 +func! sourced#something() +endfunc diff --git a/src/nvim/testdir/test_autoload.vim b/src/nvim/testdir/test_autoload.vim new file mode 100644 index 0000000000..7396c227c9 --- /dev/null +++ b/src/nvim/testdir/test_autoload.vim @@ -0,0 +1,17 @@ +" 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 + +func Test_source_autoload() + let g:loaded_sourced_vim = 0 + source sautest/autoload/sourced.vim + call assert_equal(1, g:loaded_sourced_vim) +endfunc diff --git a/src/nvim/testdir/test_escaped_glob.vim b/src/nvim/testdir/test_escaped_glob.vim index 430317a23a..eaeac28d61 100644 --- a/src/nvim/testdir/test_escaped_glob.vim +++ b/src/nvim/testdir/test_escaped_glob.vim @@ -17,6 +17,7 @@ function Test_glob() call assert_equal("", glob('Xxx\{')) call assert_equal("", glob('Xxx\$')) w! Xxx{ + " } to fix highlighting w! Xxx\$ call assert_equal("Xxx{", glob('Xxx\{')) call assert_equal("Xxx$", glob('Xxx\$')) @@ -25,9 +26,8 @@ function Test_glob() endfunction function Test_globpath() - let slash = (!exists('+shellslash') || &shellslash) ? '/' : '\' - call assert_equal('sautest'.slash.'autoload'.slash.'footest.vim', - \ globpath('sautest/autoload', '*.vim')) - call assert_equal(['sautest'.slash.'autoload'.slash.'footest.vim'], - \ globpath('sautest/autoload', '*.vim', 0, 1)) + call assert_equal(expand("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim"), + \ globpath('sautest/autoload', 'glob*.vim')) + call assert_equal([expand('sautest/autoload/globone.vim'), expand('sautest/autoload/globtwo.vim')], + \ globpath('sautest/autoload', 'glob*.vim', 0, 1)) endfunction |