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

Side by Side Diff: tests/language/constructor7_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 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 unified diff | Download patch
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 // Dart test program for constructors and initializers. 4 // Dart test program for constructors and initializers.
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 // Expect the initializer expressions E(i) to be evaluated 8 // Expect the initializer expressions E(i) to be evaluated
9 // in the order 1, 2, 3, ... 9 // in the order 1, 2, 3, ...
10 // This test has no inheritance but many fields to flush out issues with 10 // This test has no inheritance but many fields to flush out issues with
11 // ordering of fields. 11 // ordering of fields.
12 12
13 String trace = ""; 13 String trace = "";
14 14
15 int E(int i) { 15 int E(int i) {
16 trace += "$i-"; 16 trace += "$i-";
17 return i; 17 return i;
18 } 18 }
19 19
20 class A { 20 class A {
21 var j; // Names are in reverse order to detect sorting by name... 21 var j; // Names are in reverse order to detect sorting by name...
22 var i = 0; // Initialized odd/even to detect these inits affecting order. 22 var i = 0; // Initialized odd/even to detect these inits affecting order.
23 var h; 23 var h;
24 var g = 0; 24 var g = 0;
25 var f; 25 var f;
26 var e = 0; 26 var e = 0;
27 var d; 27 var d;
28 var c = 0; 28 var c = 0;
29 var b; 29 var b;
30 var a = 0; 30 var a = 0;
31 31
32 A() 32 A()
33 : a = E(1), // Initializations in different order to decls. Ascending... 33 : a = E(1), // Initializations in different order to decls. Ascending...
34 b = E(2), 34 b = E(2),
35 c = E(3), 35 c = E(3),
36 36 f = E(4), // Descending to be perverse...
37 f = E(4), // Descending to be perverse... 37 e = E(5),
38 e = E(5), 38 d = E(6),
39 d = E(6), 39 g = E(7), // Ascending again.
40 40 h = E(8),
41 g = E(7), // Ascending again. 41 i = E(9),
42 h = E(8), 42 j = E(10) {
43 i = E(9),
44 j = E(10) {
45
46 Expect.equals(1, a); 43 Expect.equals(1, a);
47 Expect.equals(2, b); 44 Expect.equals(2, b);
48 Expect.equals(3, c); 45 Expect.equals(3, c);
49 46
50 Expect.equals(4, f); 47 Expect.equals(4, f);
51 Expect.equals(5, e); 48 Expect.equals(5, e);
52 Expect.equals(6, d); 49 Expect.equals(6, d);
53 50
54 Expect.equals(7, g); 51 Expect.equals(7, g);
55 Expect.equals(8, h); 52 Expect.equals(8, h);
56 Expect.equals(9, i); 53 Expect.equals(9, i);
57 Expect.equals(10, j); 54 Expect.equals(10, j);
58 } 55 }
59 } 56 }
60 57
61 main() { 58 main() {
62 var x = new A(); 59 var x = new A();
63 Expect.equals('1-2-3-4-5-6-7-8-9-10-', trace); 60 Expect.equals('1-2-3-4-5-6-7-8-9-10-', trace);
64 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698