diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-02-07 10:41:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 10:41:02 +0100 |
commit | 120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e (patch) | |
tree | 26311a11f79d7c67f7590ace4009bb730752974c /test/functional/api/vim_spec.lua | |
parent | 017b25101a3bb428d96ee956cbe32c4fe6dcc00d (diff) | |
parent | ef2e6522c53d562928060a4872020fb8f32c8ff8 (diff) | |
download | rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.tar.gz rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.tar.bz2 rneovim-120a4c8e253a9c7f4fcd25351d4cb12ca99b4f3e.zip |
Merge pull request #11757 from bfredl/treesitter_runtime
treesitter: add standard search path for parsers + bundle c parser properly
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index d901a5e2eb..fb3755cb8e 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -23,6 +23,7 @@ local pcall_err = helpers.pcall_err local format_string = helpers.format_string local intchar2lua = helpers.intchar2lua local mergedicts_copy = helpers.mergedicts_copy +local endswith = helpers.endswith describe('API', function() before_each(clear) @@ -1853,4 +1854,27 @@ describe('API', function() command('silent! call nvim_create_buf(0, 1)') end) end) + + describe('nvim_get_runtime_file', function() + it('works', function() + eq({}, meths.get_runtime_file("bork.borkbork", false)) + eq({}, meths.get_runtime_file("bork.borkbork", true)) + eq(1, #meths.get_runtime_file("autoload/msgpack.vim", false)) + eq(1, #meths.get_runtime_file("autoload/msgpack.vim", true)) + local val = meths.get_runtime_file("autoload/remote/*.vim", true) + eq(2, #val) + local p = helpers.alter_slashes + if endswith(val[1], "define.vim") then + ok(endswith(val[1], p("autoload/remote/define.vim"))) + ok(endswith(val[2], p("autoload/remote/host.vim"))) + else + ok(endswith(val[1], p("autoload/remote/host.vim"))) + ok(endswith(val[2], p("autoload/remote/define.vim"))) + end + val = meths.get_runtime_file("autoload/remote/*.vim", false) + eq(1, #val) + ok(endswith(val[1], p("autoload/remote/define.vim")) + or endswith(val[1], p("autoload/remote/host.vim"))) + end) + end) end) |