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

Side by Side Diff: tests/compiler/dart2js_extra/17645_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 "package:expect/expect.dart";
6 6
7 // Regression test for issue 17645. 7 // Regression test for issue 17645.
8 get never => new DateTime.now().millisecondsSinceEpoch == 0; 8 get never => new DateTime.now().millisecondsSinceEpoch == 0;
9 9
10 class A { 10 class A {
11 var foo; 11 var foo;
12 A(this.foo); 12 A(this.foo);
13 } 13 }
14 14
15 var log = []; 15 var log = [];
16 16
17 test1(a, xs) { // Called with a = [null|exact=A] 17 test1(a, xs) {
18 // Called with a = [null|exact=A]
18 log.clear(); 19 log.clear();
19 for (var x in xs) { 20 for (var x in xs) {
20 if (a != null) { 21 if (a != null) {
21 log.add('${a.foo}.$x'); // a.foo must not be hoisted 22 log.add('${a.foo}.$x'); // a.foo must not be hoisted
22 } 23 }
23 } 24 }
24 return '$log'; 25 return '$log';
25 } 26 }
26 27
27 test2(a, xs) { // Called with a = [exact=A] 28 test2(a, xs) {
29 // Called with a = [exact=A]
28 log.clear(); 30 log.clear();
29 for (var x in xs) { 31 for (var x in xs) {
30 if (a != null) { 32 if (a != null) {
31 log.add('${a.foo}.$x'); // a.foo may be hoisted 33 log.add('${a.foo}.$x'); // a.foo may be hoisted
32 } 34 }
33 } 35 }
34 return '$log'; 36 return '$log';
35 } 37 }
36 38
37 test3(a, xs) { // Called with a = [null|exact=A] 39 test3(a, xs) {
40 // Called with a = [null|exact=A]
38 log.clear(); 41 log.clear();
39 for (var x in xs) { 42 for (var x in xs) {
40 if (a is A) { 43 if (a is A) {
41 log.add('${a.foo}.$x'); // a.foo must not be hoisted 44 log.add('${a.foo}.$x'); // a.foo must not be hoisted
42 } 45 }
43 } 46 }
44 return '$log'; 47 return '$log';
45 } 48 }
46 49
47 test4(a, xs) { // Called with a = [exact=A] 50 test4(a, xs) {
51 // Called with a = [exact=A]
48 log.clear(); 52 log.clear();
49 for (var x in xs) { 53 for (var x in xs) {
50 if (a is A) { 54 if (a is A) {
51 log.add('${a.foo}.$x'); // a.foo may be hoisted 55 log.add('${a.foo}.$x'); // a.foo may be hoisted
52 } 56 }
53 } 57 }
54 return '$log'; 58 return '$log';
55 } 59 }
56 60
57
58 main() { 61 main() {
59 var a1 = new A('a1'); 62 var a1 = new A('a1');
60 var a2 = new A('a2'); 63 var a2 = new A('a2');
61 64
62 Expect.equals('[a1.11]', test1(a1, [11])); 65 Expect.equals('[a1.11]', test1(a1, [11]));
63 Expect.equals('[]', test1(null, [11])); 66 Expect.equals('[]', test1(null, [11]));
64 67
65 Expect.equals('[a1.22]', test2(a1, [22])); 68 Expect.equals('[a1.22]', test2(a1, [22]));
66 Expect.equals('[a2.22]', test2(a2, [22])); 69 Expect.equals('[a2.22]', test2(a2, [22]));
67 70
68
69 Expect.equals('[a1.33]', test3(a1, [33])); 71 Expect.equals('[a1.33]', test3(a1, [33]));
70 Expect.equals('[]', test3(null, [2])); 72 Expect.equals('[]', test3(null, [2]));
71 73
72 Expect.equals('[a1.44]', test4(a1, [44])); 74 Expect.equals('[a1.44]', test4(a1, [44]));
73 Expect.equals('[a2.44]', test4(a2, [44])); 75 Expect.equals('[a2.44]', test4(a2, [44]));
74 } 76 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/17094_test.dart ('k') | tests/compiler/dart2js_extra/17856_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698