diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-07-05 00:30:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-05 00:30:05 -0700 |
commit | 5936a88f181e52e17484d4ae6dfaea7d50d43935 (patch) | |
tree | ef727393e94037e5a675f566b59b1014f8fe2a29 /test/functional/lua/ui_spec.lua | |
parent | b2e8c0df2062f765a4cf7d96379c5f0f19393dfd (diff) | |
parent | e644e7ce0b36dd5e75770f3faa0a84f15e2561e8 (diff) | |
download | rneovim-5936a88f181e52e17484d4ae6dfaea7d50d43935.tar.gz rneovim-5936a88f181e52e17484d4ae6dfaea7d50d43935.tar.bz2 rneovim-5936a88f181e52e17484d4ae6dfaea7d50d43935.zip |
Merge #23401 vim.ui.open: "gx" without netrw
Diffstat (limited to 'test/functional/lua/ui_spec.lua')
-rw-r--r-- | test/functional/lua/ui_spec.lua | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua index 9ee99b4905..d1b64419af 100644 --- a/test/functional/lua/ui_spec.lua +++ b/test/functional/lua/ui_spec.lua @@ -1,9 +1,11 @@ local helpers = require('test.functional.helpers')(after_each) local eq = helpers.eq +local matches = helpers.matches local exec_lua = helpers.exec_lua local clear = helpers.clear local feed = helpers.feed local eval = helpers.eval +local is_os = helpers.is_os local poke_eventloop = helpers.poke_eventloop describe('vim.ui', function() @@ -11,8 +13,7 @@ describe('vim.ui', function() clear() end) - - describe('select', function() + describe('select()', function() it('can select an item', function() local result = exec_lua[[ local items = { @@ -47,7 +48,7 @@ describe('vim.ui', function() end) end) - describe('input', function() + describe('input()', function() it('can input text', function() local result = exec_lua[[ local opts = { @@ -130,4 +131,20 @@ describe('vim.ui', function() end) end) + + describe('open()', function() + it('validation', function() + if not is_os('bsd') then + matches('vim.ui.open: command failed %(%d%): { "[^"]+", "non%-existent%-file" }', + exec_lua[[local _, err = vim.ui.open('non-existent-file') ; return err]]) + end + + exec_lua[[ + vim.fn.has = function() return 0 end + vim.fn.executable = function() return 0 end + ]] + eq('vim.ui.open: no handler found (tried: wslview, xdg-open)', + exec_lua[[local _, err = vim.ui.open('foo') ; return err]]) + end) + end) end) |