mirror of
https://github.com/neovim/neovim.git
synced 2026-02-21 09:50:19 +10:00
Merge #23401 vim.ui.open: "gx" without netrw
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user