From a53e17948f408637ce1ab19ab6eafeef2fc80a54 Mon Sep 17 00:00:00 2001 From: Tom van Dijck Date: Wed, 21 Jun 2017 09:52:25 -0700 Subject: [PATCH] Hook setTextColor in tests, so on linux/mac we don't get random color changes but no output. --- modules/self-test/test_runner.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/self-test/test_runner.lua b/modules/self-test/test_runner.lua index acaf2ca8..31e2395d 100644 --- a/modules/self-test/test_runner.lua +++ b/modules/self-test/test_runner.lua @@ -115,6 +115,7 @@ hooks.os_writefile_ifnotequal = os.writefile_ifnotequal hooks.p_utf8 = p.utf8 hooks.print = print + hooks.setTextColor = term.setTextColor local mt = getmetatable(io.stderr) _.builtin_write = mt.write @@ -128,6 +129,7 @@ os.writefile_ifnotequal = _.stub_os_writefile_ifnotequal print = _.stub_print p.utf8 = _.stub_utf8 + term.setTextColor = _.stub_setTextColor stderr_capture = nil @@ -158,6 +160,7 @@ os.writefile_ifnotequal = hooks.os_writefile_ifnotequal p.utf8 = hooks.p_utf8 print = hooks.print + term.setTextColor = hooks.setTextColor local mt = getmetatable(io.stderr) mt.write = _.builtin_write @@ -263,3 +266,7 @@ function _.stub_utf8() end + + + function _.stub_setTextColor() + end