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

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

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 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
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 "package:async_helper/async_helper.dart";
9 import 'codegen_helper.dart'; 9 import 'codegen_helper.dart';
10 10
11 void main() { 11 void main() {
12 asyncTest(() => generate(SOURCE).then((result) { 12 asyncTest(() => generate(SOURCE).then((result) {
13 var code = result['test']; 13 var code = result['test'];
14 Expect.isNotNull(code); 14 Expect.isNotNull(code);
15 Expect.equals(0, new RegExp('add').allMatches(code).length); 15 Expect.equals(0, new RegExp('add').allMatches(code).length);
16 Expect.equals(3, new RegExp('\\+').allMatches(code).length); 16 Expect.equals(3, new RegExp('\\+').allMatches(code).length);
17 })); 17 }));
18 } 18 }
19 19
20 const String SOURCE = """ 20 const String SOURCE = """
21 test(a, b, c, d) { 21 test(a, b, c, d) {
22 if (a is !num) throw 'a not num'; 22 if (a is !num) throw 'a not num';
23 if (b is !num) throw 'b not num'; 23 if (b is !num) throw 'b not num';
24 if (c is !num) throw 'c not num'; 24 if (c is !num) throw 'c not num';
25 if (d is !num) throw 'd not num'; 25 if (d is !num) throw 'd not num';
26 return a + b + c + d; 26 return a + b + c + d;
27 } 27 }
28 28
29 main() { 29 main() {
30 test(1, 2, 3, 4); 30 test(1, 2, 3, 4);
31 test('x', 'y', 'z', 'w'); 31 test('x', 'y', 'z', 'w');
32 test([], {}, [], {}); 32 test([], {}, [], {});
33 } 33 }
34 """; 34 """;
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/reexport_handled_test.dart ('k') | tests/compiler/dart2js/related_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698