Skip to content

Commit 5cbb174

Browse files
committed
fix(bench press): Don’t use unicode in console reporter to prevent problems
1 parent 8541cfd commit 5cbb174

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

modules/benchpress/src/reporter/console_reporter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export class ConsoleReporter extends Reporter {
8484
var mean = Statistic.calculateMean(sample);
8585
var cv = Statistic.calculateCoefficientOfVariation(sample, mean);
8686
var formattedCv = NumberWrapper.isNaN(cv) ? 'NaN' : Math.floor(cv);
87-
return `${ConsoleReporter._formatNum(mean)}\u00B1${formattedCv}%`;
87+
// Note: Don't use the unicode character for +- as it might cause
88+
// hickups consoles...
89+
return `${ConsoleReporter._formatNum(mean)}+-${formattedCv}%`;
8890
})
8991
);
9092
return PromiseWrapper.resolve(null);

modules/benchpress/test/reporter/console_reporter_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function main() {
9292
})]);
9393
expect(log).toEqual([
9494
'======== | ========',
95-
'4.00±25% | 7.50±20%'
95+
'4.00+-25% | 7.50+-20%'
9696
]);
9797
});
9898

0 commit comments

Comments
 (0)