From 5cbb174a6d2043378d177e15874d812c543c56bb Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Thu, 26 Feb 2015 12:54:57 -0800 Subject: [PATCH] =?UTF-8?q?fix(bench=20press):=20Don=E2=80=99t=20use=20uni?= =?UTF-8?q?code=20in=20console=20reporter=20to=20prevent=20problems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/benchpress/src/reporter/console_reporter.js | 4 +++- modules/benchpress/test/reporter/console_reporter_spec.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/benchpress/src/reporter/console_reporter.js b/modules/benchpress/src/reporter/console_reporter.js index b343617c0f..7682a6d4bc 100644 --- a/modules/benchpress/src/reporter/console_reporter.js +++ b/modules/benchpress/src/reporter/console_reporter.js @@ -84,7 +84,9 @@ export class ConsoleReporter extends Reporter { var mean = Statistic.calculateMean(sample); var cv = Statistic.calculateCoefficientOfVariation(sample, mean); var formattedCv = NumberWrapper.isNaN(cv) ? 'NaN' : Math.floor(cv); - return `${ConsoleReporter._formatNum(mean)}\u00B1${formattedCv}%`; + // Note: Don't use the unicode character for +- as it might cause + // hickups consoles... + return `${ConsoleReporter._formatNum(mean)}+-${formattedCv}%`; }) ); return PromiseWrapper.resolve(null); diff --git a/modules/benchpress/test/reporter/console_reporter_spec.js b/modules/benchpress/test/reporter/console_reporter_spec.js index 00c544bc43..8c06442c49 100644 --- a/modules/benchpress/test/reporter/console_reporter_spec.js +++ b/modules/benchpress/test/reporter/console_reporter_spec.js @@ -92,7 +92,7 @@ export function main() { })]); expect(log).toEqual([ '======== | ========', - '4.00±25% | 7.50±20%' + '4.00+-25% | 7.50+-20%' ]); });