diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-24 12:59:59 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-24 12:59:59 -0300 |
commit | ed1070bb24d61cfeb13c7afa65de64540dabe535 (patch) | |
tree | 751ad22670cb9b40329a84773e783ba3b8c357f3 /third-party/utfTerminalDetailed.lua | |
parent | 5860d65f9cf4205b845e4fb5e8512ef8929cf227 (diff) | |
parent | 1ee7ca7bc0739526bf07ddc0cfc9fbbd18523591 (diff) | |
download | rneovim-ed1070bb24d61cfeb13c7afa65de64540dabe535.tar.gz rneovim-ed1070bb24d61cfeb13c7afa65de64540dabe535.tar.bz2 rneovim-ed1070bb24d61cfeb13c7afa65de64540dabe535.zip |
Merge PR #2146 'Improve functional test debuggability and efficiency'
Diffstat (limited to 'third-party/utfTerminalDetailed.lua')
-rw-r--r-- | third-party/utfTerminalDetailed.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/third-party/utfTerminalDetailed.lua b/third-party/utfTerminalDetailed.lua index 4d7a7c1d6f..5a52dfa958 100644 --- a/third-party/utfTerminalDetailed.lua +++ b/third-party/utfTerminalDetailed.lua @@ -1,13 +1,18 @@ -- busted output handler that immediately prints file and test names before -- tests are executed. It simplifies identifying which tests are -- hanging/crashing -local ansicolors = require 'ansicolors' +if package.config:sub(1,1) == '\\' and not os.getenv("ANSICON") then + -- Disable colors on Windows. + colors = setmetatable({}, {__index = function() return function(s) return s end end}) +else + colors = require 'term.colors' +end return function(options, busted) local handler = require 'busted.outputHandlers.utfTerminal'(options, busted) handler.fileStart = function(name) - io.write('\n' .. ansicolors('%{cyan}' .. name) .. ':') + io.write('\n' .. colors.cyan(name) .. ':') end handler.testStart = function(element, parent, status, debug) |