fix(bench press): Don’t use unicode in console reporter to prevent problems

This commit is contained in:
Tobias Bosch 2015-02-26 12:54:57 -08:00
parent 8541cfd26d
commit 5cbb174a6d
2 changed files with 4 additions and 2 deletions

View File

@ -84,7 +84,9 @@ export class ConsoleReporter extends Reporter {
var mean = Statistic.calculateMean(sample); var mean = Statistic.calculateMean(sample);
var cv = Statistic.calculateCoefficientOfVariation(sample, mean); var cv = Statistic.calculateCoefficientOfVariation(sample, mean);
var formattedCv = NumberWrapper.isNaN(cv) ? 'NaN' : Math.floor(cv); 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); return PromiseWrapper.resolve(null);

View File

@ -92,7 +92,7 @@ export function main() {
})]); })]);
expect(log).toEqual([ expect(log).toEqual([
'======== | ========', '======== | ========',
'4.00±25% | 7.50±20%' '4.00+-25% | 7.50+-20%'
]); ]);
}); });