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

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

Issue 17759007: First pass at asynchronous input loading in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 years, 3 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Regression test for http://dartbug.com/10231. 5 // Regression test for http://dartbug.com/10231.
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import "package:async_helper/async_helper.dart";
8 import 'codegen_helper.dart'; 9 import 'codegen_helper.dart';
9 10
10 void main() { 11 void main() {
11 var code = generate(SOURCE)['test']; 12 asyncTest(() => generate(SOURCE).then((result) {
12 Expect.isNotNull(code); 13 var code = result['test'];
13 Expect.equals(0, new RegExp('add').allMatches(code).length); 14 Expect.isNotNull(code);
14 Expect.equals(3, new RegExp('\\+').allMatches(code).length); 15 Expect.equals(0, new RegExp('add').allMatches(code).length);
16 Expect.equals(3, new RegExp('\\+').allMatches(code).length);
17 }));
15 } 18 }
16 19
17 const String SOURCE = """ 20 const String SOURCE = """
18 test(a, b, c, d) { 21 test(a, b, c, d) {
19 if (a is !num) throw 'a not num'; 22 if (a is !num) throw 'a not num';
20 if (b is !num) throw 'b not num'; 23 if (b is !num) throw 'b not num';
21 if (c is !num) throw 'c not num'; 24 if (c is !num) throw 'c not num';
22 if (d is !num) throw 'd not num'; 25 if (d is !num) throw 'd not num';
23 return a + b + c + d; 26 return a + b + c + d;
24 } 27 }
25 28
26 main() { 29 main() {
27 test(1, 2, 3, 4); 30 test(1, 2, 3, 4);
28 test('x', 'y', 'z', 'w'); 31 test('x', 'y', 'z', 'w');
29 test([], {}, [], {}); 32 test([], {}, [], {});
30 } 33 }
31 """; 34 """;
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/reexport_handled_test.dart ('k') | tests/compiler/dart2js/resolution_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698