From 50419e584d5cdf28cf5533c3501ed40734533fa1 Mon Sep 17 00:00:00 2001 From: James Rhodes Date: Thu, 30 May 2013 20:56:16 -0700 Subject: [PATCH] Fixing the star on unit tests for Windows consoles Summary: On Windows consoles, the star on the unit tests (I'm assuming it's a Unicode character of some kind), doesn't render correctly and you just get garbage. This fixes it so that on Windows, it falls back to just using an ASCII asterisk. Test Plan: On Windows run some unit tests, the star should now be a plain asterisk. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6087 --- src/unit/renderer/ArcanistUnitConsoleRenderer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/unit/renderer/ArcanistUnitConsoleRenderer.php b/src/unit/renderer/ArcanistUnitConsoleRenderer.php index 974a7979..a20265f0 100644 --- a/src/unit/renderer/ArcanistUnitConsoleRenderer.php +++ b/src/unit/renderer/ArcanistUnitConsoleRenderer.php @@ -47,8 +47,13 @@ final class ArcanistUnitConsoleRenderer extends ArcanistUnitRenderer { private function formatTestDuration($seconds) { // Very carefully define inclusive upper bounds on acceptable unit test // durations. Times are in milliseconds and are in increasing order. + $star = "\xE2\x98\x85"; + if (phutil_is_windows()) { + // Fall-back to normal asterisk for Windows consoles. + $star = "*"; + } $acceptableness = array( - 50 => "%s\xE2\x98\x85 ", + 50 => "%s{$star} ", 200 => '%s ', 500 => '%s ', INF => '%s ',