diff options
author | Lewis Russell <lewis6991@gmail.com> | 2021-12-16 11:40:23 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2022-02-15 23:00:28 +0000 |
commit | d512be55a2ea54dd83914ff25f57c02d703f93b4 (patch) | |
tree | 4e26bdff5f735d996d69497d925bc38ee776c86c /test/functional/api/vim_spec.lua | |
parent | 238b944e58d12a28245be996e69bf36a2a452a90 (diff) | |
download | rneovim-d512be55a2ea54dd83914ff25f57c02d703f93b4.tar.gz rneovim-d512be55a2ea54dd83914ff25f57c02d703f93b4.tar.bz2 rneovim-d512be55a2ea54dd83914ff25f57c02d703f93b4.zip |
fix(api): re-route nvim_get_runtime_file errors
This allows nvim_get_runtime_file to be properly used via pcall
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 5a387f3deb..71cd055e08 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -23,6 +23,7 @@ local next_msg = helpers.next_msg local tmpname = helpers.tmpname local write_file = helpers.write_file local exec_lua = helpers.exec_lua +local exc_exec = helpers.exc_exec local pcall_err = helpers.pcall_err local format_string = helpers.format_string @@ -2240,6 +2241,14 @@ describe('API', function() eq({}, meths.get_runtime_file("foobarlang/", true)) end) + it('can handle bad patterns', function() + if helpers.pending_win32(pending) then return end + + eq("Vim:E220: Missing }.", pcall_err(meths.get_runtime_file, "{", false)) + + eq('Vim(echo):E5555: API call: Vim:E220: Missing }.', + exc_exec("echo nvim_get_runtime_file('{', v:false)")) + end) end) describe('nvim_get_all_options_info', function() |