fix(benchpress): benchpress fixes and a smoke test for Dart
This commit is contained in:
@@ -95,6 +95,14 @@ class StringJoiner {
|
||||
}
|
||||
|
||||
class NumberWrapper {
|
||||
static String toFixed(num n, int fractionDigits) {
|
||||
return n.toStringAsFixed(fractionDigits);
|
||||
}
|
||||
|
||||
static bool equal(num a, num b) {
|
||||
return a == b;
|
||||
}
|
||||
|
||||
static int parseIntAutoRadix(String text) {
|
||||
return int.parse(text);
|
||||
}
|
||||
|
||||
@@ -138,6 +138,14 @@ export class NumberParseError extends Error {
|
||||
|
||||
|
||||
export class NumberWrapper {
|
||||
static toFixed(n:number, fractionDigits:int):string {
|
||||
return n.toFixed(fractionDigits);
|
||||
}
|
||||
|
||||
static equal(a, b):boolean {
|
||||
return a === b;
|
||||
}
|
||||
|
||||
static parseIntAutoRadix(text:string):int {
|
||||
var result:int = parseInt(text);
|
||||
if (isNaN(result)) {
|
||||
|
||||
+2
-2
@@ -123,11 +123,11 @@ void _runTests() {
|
||||
// Read in input & output files.
|
||||
config.assetPathToInputPath.forEach((key, value) {
|
||||
config.assetPathToInputPath[key] =
|
||||
cache.putIfAbsent(value, () => new File(value).readAsStringSync());
|
||||
cache.putIfAbsent(value, () => new File('test/transform/${value}').readAsStringSync());
|
||||
});
|
||||
config.assetPathToExpectedOutputPath.forEach((key, value) {
|
||||
config.assetPathToExpectedOutputPath[key] = cache.putIfAbsent(value, () {
|
||||
var code = new File(value).readAsStringSync();
|
||||
var code = new File('test/transform/${value}').readAsStringSync();
|
||||
return value.endsWith('dart') ? formatter.format(code) : code;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user