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

Side by Side Diff: tests/compiler/dart2js/builtin_interceptor_test.dart

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import 'dart:async';
6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart';
6 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
7 9
8 const String TEST_ONE = r""" 10 const String TEST_ONE = r"""
9 foo() { 11 foo() {
10 return "foo".length; 12 return "foo".length;
11 } 13 }
12 """; 14 """;
13 15
14 const String TEST_TWO = r""" 16 const String TEST_TWO = r"""
15 foo() { 17 foo() {
16 return r"foo".length; 18 return r"foo".length;
17 } 19 }
18 """; 20 """;
19 21
20 const String TEST_THREE = r""" 22 const String TEST_THREE = r"""
21 foo() { 23 foo() {
22 return new List().add(2); 24 return new List().add(2);
23 } 25 }
24 """; 26 """;
25 27
26 main() { 28 main() {
27 String generated = compile(TEST_ONE, entry: 'foo'); 29 asyncTest(() => Future.wait([
28 Expect.isTrue(generated.contains("return 3;")); 30 compile(TEST_ONE, entry: 'foo', check: (String generated) {
29 31 Expect.isTrue(generated.contains("return 3;"));
30 generated = compile(TEST_TWO, entry: 'foo'); 32 }),
31 Expect.isTrue(generated.contains("return 3;")); 33 compile(TEST_TWO, entry: 'foo', check: (String generated) {
32 34 Expect.isTrue(generated.contains("return 3;"));
33 generated = compile(TEST_THREE, entry: 'foo'); 35 }),
34 Expect.isTrue(generated.contains("push(2);")); 36 compile(TEST_THREE, entry: 'foo', check: (String generated) {
37 Expect.isTrue(generated.contains("push(2);"));
38 }),
39 ]));
35 } 40 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/builtin_equals_test.dart ('k') | tests/compiler/dart2js/closure_codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698