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

Unified Diff: tests/compiler/dart2js/load_elimination_test.dart

Issue 1112563002: Refactor SsaBuilder.visitStaticSend and visitGetterSend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/semantic_visitor_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/load_elimination_test.dart
diff --git a/tests/compiler/dart2js/load_elimination_test.dart b/tests/compiler/dart2js/load_elimination_test.dart
index 8104757d1cbed0a57a90934eefc5b3580f106523..a5d4147fb2222f4782f09a213bd7f0f9749dd124 100644
--- a/tests/compiler/dart2js/load_elimination_test.dart
+++ b/tests/compiler/dart2js/load_elimination_test.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'dart:async';
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import 'compiler_helper.dart';
@@ -235,27 +236,31 @@ void main() {
main() {
- test(String code, Function f) {
- asyncTest(() => compileAll(code, disableInlining: false).then((generated) {
- Expect.isTrue(f(generated));
- }));
+ test(String code, String expected) {
+ return () => compileAll(code, disableInlining: false).then((generated) {
+ Expect.isTrue(generated.contains(expected),
+ "Generated code didn't contain '$expected'.\n"
+ "Test:\n$code, Generated:\n$generated");
+ });
}
- test(TEST_1, (generated) => generated.contains('return 42'));
- test(TEST_2, (generated) => generated.contains('return 42'));
- test(TEST_3, (generated) => generated.contains('return 84'));
- test(TEST_4, (generated) => generated.contains('return t1 + t1'));
- test(TEST_5, (generated) => generated.contains('return 84'));
- test(TEST_6, (generated) => generated.contains('return 84'));
- test(TEST_7, (generated) => generated.contains('return 32'));
- test(TEST_8, (generated) => generated.contains('return a.a'));
- test(TEST_9, (generated) => generated.contains('return a.a'));
- test(TEST_10, (generated) => generated.contains('return 2'));
- test(TEST_11, (generated) => generated.contains('return a.a'));
- test(TEST_12, (generated) => generated.contains('return 6'));
- test(TEST_13, (generated) => generated.contains('return 6'));
- test(TEST_14, (generated) => generated.contains('return t1[0]'));
- test(TEST_15, (generated) => generated.contains('return 42'));
- test(TEST_16, (generated) => generated.contains('return \$.a'));
- test(TEST_17, (generated) => generated.contains('return t1'));
- test(TEST_18, (generated) => generated.contains('return t1'));
+ asyncTest(() => Future.forEach([
+ test(TEST_1, 'return 42'),
+ test(TEST_2, 'return 42'),
+ test(TEST_3, 'return 84'),
+ test(TEST_4, 'return t1 + t1'),
+ test(TEST_5, 'return 84'),
+ test(TEST_6, 'return 84'),
+ test(TEST_7, 'return 32'),
+ test(TEST_8, 'return a.a'),
+ test(TEST_9, 'return a.a'),
+ test(TEST_10, 'return 2'),
+ test(TEST_11, 'return a.a'),
+ test(TEST_12, 'return 6'),
+ test(TEST_13, 'return 6'),
+ test(TEST_14, 'return t1[0]'),
+ test(TEST_15, 'return 42'),
+ test(TEST_16, 'return \$.a'),
+ test(TEST_17, 'return t1'),
+ test(TEST_18, 'return t1'),
+ ], (f) => f()));
}
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/semantic_visitor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698