Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: test/codegen/expect/BenchmarkBase.js

Issue 1989663002: fix #470, string interpolation now respects Dart toString (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/browser/language_tests.js ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 dart_library.library('BenchmarkBase', null, /* Imports */[ 1 dart_library.library('BenchmarkBase', null, /* Imports */[
2 'dart_sdk' 2 'dart_sdk'
3 ], function(exports, dart_sdk) { 3 ], function(exports, dart_sdk) {
4 'use strict'; 4 'use strict';
5 const core = dart_sdk.core; 5 const core = dart_sdk.core;
6 const dart = dart_sdk.dart; 6 const dart = dart_sdk.dart;
7 const dartx = dart_sdk.dartx; 7 const dartx = dart_sdk.dartx;
8 const BenchmarkBase$ = Object.create(null); 8 const BenchmarkBase$ = Object.create(null);
9 BenchmarkBase$.Expect = class Expect extends core.Object { 9 BenchmarkBase$.Expect = class Expect extends core.Object {
10 static equals(expected, actual) { 10 static equals(expected, actual) {
11 if (!dart.equals(expected, actual)) { 11 if (!dart.equals(expected, actual)) {
12 dart.throw(`Values not equal: ${expected} vs ${actual}`); 12 dart.throw(dart.str`Values not equal: ${expected} vs ${actual}`);
13 } 13 }
14 } 14 }
15 static listEquals(expected, actual) { 15 static listEquals(expected, actual) {
16 if (expected[dartx.length] != actual[dartx.length]) { 16 if (expected[dartx.length] != actual[dartx.length]) {
17 dart.throw(`Lists have different lengths: ${expected[dartx.length]} vs $ {actual[dartx.length]}`); 17 dart.throw(dart.str`Lists have different lengths: ${expected[dartx.lengt h]} vs ${actual[dartx.length]}`);
18 } 18 }
19 for (let i = 0; i < dart.notNull(actual[dartx.length]); i++) { 19 for (let i = 0; i < dart.notNull(actual[dartx.length]); i++) {
20 BenchmarkBase$.Expect.equals(expected[dartx.get](i), actual[dartx.get](i )); 20 BenchmarkBase$.Expect.equals(expected[dartx.get](i), actual[dartx.get](i ));
21 } 21 }
22 } 22 }
23 fail(message) { 23 fail(message) {
24 dart.throw(message); 24 dart.throw(message);
25 } 25 }
26 }; 26 };
27 dart.setSignature(BenchmarkBase$.Expect, { 27 dart.setSignature(BenchmarkBase$.Expect, {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 this.warmup(); 66 this.warmup();
67 }), 100); 67 }), 100);
68 let result = BenchmarkBase$.BenchmarkBase.measureFor(dart.fn(() => { 68 let result = BenchmarkBase$.BenchmarkBase.measureFor(dart.fn(() => {
69 this.exercise(); 69 this.exercise();
70 }), 2000); 70 }), 2000);
71 this.teardown(); 71 this.teardown();
72 return result; 72 return result;
73 } 73 }
74 report() { 74 report() {
75 let score = this.measure(); 75 let score = this.measure();
76 core.print(`${this.name}(RunTime): ${score} us.`); 76 core.print(dart.str`${this.name}(RunTime): ${score} us.`);
77 } 77 }
78 }; 78 };
79 dart.setSignature(BenchmarkBase$.BenchmarkBase, { 79 dart.setSignature(BenchmarkBase$.BenchmarkBase, {
80 constructors: () => ({new: [BenchmarkBase$.BenchmarkBase, [core.String]]}), 80 constructors: () => ({new: [BenchmarkBase$.BenchmarkBase, [core.String]]}),
81 methods: () => ({ 81 methods: () => ({
82 run: [dart.void, []], 82 run: [dart.void, []],
83 warmup: [dart.void, []], 83 warmup: [dart.void, []],
84 exercise: [dart.void, []], 84 exercise: [dart.void, []],
85 setup: [dart.void, []], 85 setup: [dart.void, []],
86 teardown: [dart.void, []], 86 teardown: [dart.void, []],
87 measure: [core.double, []], 87 measure: [core.double, []],
88 report: [dart.void, []] 88 report: [dart.void, []]
89 }), 89 }),
90 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}), 90 statics: () => ({measureFor: [core.double, [core.Function, core.int]]}),
91 names: ['measureFor'] 91 names: ['measureFor']
92 }); 92 });
93 // Exports: 93 // Exports:
94 exports.BenchmarkBase = BenchmarkBase$; 94 exports.BenchmarkBase = BenchmarkBase$;
95 }); 95 });
OLDNEW
« no previous file with comments | « test/browser/language_tests.js ('k') | test/codegen/expect/DeltaBlue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698