aboutsummaryrefslogtreecommitdiff
path: root/test/busted
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /test/busted
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'test/busted')
-rw-r--r--test/busted/outputHandlers/nvim.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/busted/outputHandlers/nvim.lua b/test/busted/outputHandlers/nvim.lua
index 2ce32c3b7a..4bfa21fe49 100644
--- a/test/busted/outputHandlers/nvim.lua
+++ b/test/busted/outputHandlers/nvim.lua
@@ -1,9 +1,15 @@
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 == nil and '' or tostring(s) end end})
+
+local enable_colors = true
if os.getenv "TEST_COLORS" then
+ local test_colors = os.getenv("TEST_COLORS"):lower()
+ local disable_colors = test_colors == 'false' or test_colors == '0' or test_colors == 'no' or test_colors == 'off'
+ enable_colors = not disable_colors
+end
+if enable_colors then
colors = require 'term.colors'
end
@@ -204,7 +210,7 @@ return function(options)
handler.fileStart = function(file)
fileTestCount = 0
- io.write(fileStartString:format(file.name))
+ io.write(fileStartString:format(vim.fs.normalize(file.name)))
io.flush()
return nil, true
end
@@ -213,7 +219,7 @@ return function(options)
local elapsedTime_ms = getElapsedTime(file)
local tests = (fileTestCount == 1 and 'test' or 'tests')
fileCount = fileCount + 1
- io.write(fileEndString:format(fileTestCount, tests, file.name, elapsedTime_ms))
+ io.write(fileEndString:format(fileTestCount, tests, vim.fs.normalize(file.name), elapsedTime_ms))
io.flush()
return nil, true
end