1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-09-20 00:49:11 +02:00

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
This commit is contained in:
James Rhodes 2013-05-30 20:56:16 -07:00 committed by epriestley
parent a03c2a10ea
commit 50419e584d

View file

@ -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 => "<fg:green>%s</fg><fg:yellow>\xE2\x98\x85</fg> ",
50 => "<fg:green>%s</fg><fg:yellow>{$star}</fg> ",
200 => '<fg:green>%s</fg> ',
500 => '<fg:yellow>%s</fg> ',
INF => '<fg:red>%s</fg> ',