diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /test/functional/lua/ui_spec.lua | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/lua/ui_spec.lua')
-rw-r--r-- | test/functional/lua/ui_spec.lua | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua index 9ee99b4905..d4c150c5f2 100644 --- a/test/functional/lua/ui_spec.lua +++ b/test/functional/lua/ui_spec.lua @@ -1,9 +1,12 @@ 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_ci = helpers.is_ci +local is_os = helpers.is_os local poke_eventloop = helpers.poke_eventloop describe('vim.ui', function() @@ -11,8 +14,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 +49,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 +132,23 @@ describe('vim.ui', function() end) end) + + describe('open()', function() + it('validation', function() + if is_os('win') or not is_ci('github') then + exec_lua[[vim.system = function() return { wait=function() return { code=3} end } end]] + end + 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) |