mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(test runner): handle nil in no-colors output handler #15679
Problem:
13748512f6
#15610 The no-colors codepath of the nvim.lua test output
handler does not handle nil, leading to weird symptoms if e.g. a test
has a syntax error:
test/busted/outputHandlers/nvim.lua:105: attempt to concatenate a nil value
Solution:
Coerce to string in no-colors handler.
This commit is contained in:
@ -2,7 +2,7 @@ local pretty = require 'pl.pretty'
|
||||
local global_helpers = require('test.helpers')
|
||||
|
||||
-- Colors are disabled by default. #15610
|
||||
local colors = setmetatable({}, {__index = function() return function(s) return s end end})
|
||||
local colors = setmetatable({}, {__index = function() return function(s) return s == nil and '' or tostring(s) end end})
|
||||
if os.getenv "TEST_COLORS" then
|
||||
colors = require 'term.colors'
|
||||
end
|
||||
|
Reference in New Issue
Block a user