mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07: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:
parent
d140d3bd33
commit
9d5d72c388
@ -2,7 +2,7 @@ local pretty = require 'pl.pretty'
|
|||||||
local global_helpers = require('test.helpers')
|
local global_helpers = require('test.helpers')
|
||||||
|
|
||||||
-- Colors are disabled by default. #15610
|
-- 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
|
if os.getenv "TEST_COLORS" then
|
||||||
colors = require 'term.colors'
|
colors = require 'term.colors'
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user