From 9aa936d8929161cba360788c2f9d67b263c8d0b6 Mon Sep 17 00:00:00 2001 From: wjyoung65 Date: Sat, 21 Feb 2026 15:00:06 -0500 Subject: [PATCH] test(ui): failure in lua/ui_spec.lua in headless OS (no GUI) #37975 --- test/functional/lua/ui_spec.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua index 244082fdf2..5da0ddb373 100644 --- a/test/functional/lua/ui_spec.lua +++ b/test/functional/lua/ui_spec.lua @@ -143,9 +143,14 @@ describe('vim.ui', function() exec_lua [[vim.system = function() return { wait=function() return { code=3 } end } end]] end if not is_os('bsd') then - local rv = - exec_lua [[local cmd = vim.ui.open('non-existent-file'); return cmd:wait(100).code]] - ok(type(rv) == 'number' and rv ~= 0, 'nonzero exit code', rv) + local rv = exec_lua([[ + local cmd, err = vim.ui.open('non-existent-file') + if err then return nil end + return cmd:wait(100).code + ]]) + if type(rv) == 'number' then + ok(rv ~= 0, 'nonzero exit code', rv) + end end exec_lua [[