diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2021-09-16 11:42:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 11:42:00 -0700 |
commit | 9d5d72c388b404c7e9e7aedd521bb5abe46c9436 (patch) | |
tree | ec57a9ca2f46ce2c1f7d17789c5ab5700760ad59 | |
parent | d140d3bd33010b968908059bc49b161ed33395fe (diff) | |
download | rneovim-9d5d72c388b404c7e9e7aedd521bb5abe46c9436.tar.gz rneovim-9d5d72c388b404c7e9e7aedd521bb5abe46c9436.tar.bz2 rneovim-9d5d72c388b404c7e9e7aedd521bb5abe46c9436.zip |
fix(test runner): handle nil in no-colors output handler #15679
Problem:
13748512f6d6 #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.
-rw-r--r-- | test/busted/outputHandlers/nvim.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/busted/outputHandlers/nvim.lua b/test/busted/outputHandlers/nvim.lua index 31d3415e35..0e9801b94b 100644 --- a/test/busted/outputHandlers/nvim.lua +++ b/test/busted/outputHandlers/nvim.lua @@ -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 |