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

Side by Side Diff: tests/language_strong/compile_time_constant_e_test.dart

Issue 2994383002: Migrating block 50, first commit, after tool has run (Closed)
Patch Set: Updated status files based on feedback from whesse Created 3 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
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "package:expect/expect.dart";
6
7 class A {
8 final x;
9 final y;
10 final z;
11 final t;
12
13 const A([this.z = 99, tt = 100])
14 : y = 499,
15 t = tt,
16 x = 3;
17 const A.n({this.z: 99, tt: 100})
18 : y = 499,
19 t = tt,
20 x = 3;
21 const A.named({z, this.t})
22 : y = 400 + z,
23 this.z = z,
24 x = 3;
25 const A.named2({t, z, y, x})
26 : x = t,
27 y = z,
28 z = y,
29 t = x;
30
31 toString() => "A $x $y $z $t";
32 }
33
34 const a1 = const A(99, 100);
35 const a1n = const A.n(99, 100);
36 const a2 = const A.named(z: 99, t: 100);
37 const a3 = const A.named2(t: 1, z: 2, y: 3, x: 4);
38 const a4 = const A();
39 const a5 = const A(99, 100);
40 const a5n = const A.n(tt: 100, z: 99);
41 const a6 = const A(1, 2);
42 const a6n = const A.n(z: 1, tt: 2);
43 const a7 = const A.named(z: 7);
44 const a8 = const A.named2();
45 const a9 = const A.named2(x: 4, y: 3, z: 2, t: 1);
46 const a10 = const A.named2(x: 1, y: 2, z: 3, t: 4);
47
48 main() {
49 Expect.equals(3, a1.x);
50 Expect.equals(499, a1.y);
51 Expect.equals(99, a1.z);
52 Expect.equals(100, a1.t);
53 Expect.equals("A 3 499 99 100", a1.toString());
54 Expect.isTrue(identical(a1, a2));
55 Expect.isTrue(identical(a1, a4));
56 Expect.isTrue(identical(a1, a5));
57
58 Expect.equals(1, a3.x);
59 Expect.equals(2, a3.y);
60 Expect.equals(3, a3.z);
61 Expect.equals(4, a3.t);
62 Expect.equals("A 1 2 3 4", a3.toString());
63
64 Expect.equals(3, a6.x);
65 Expect.equals(499, a6.y);
66 Expect.equals(1, a6.z);
67 Expect.equals(2, a6.t);
68 Expect.equals("A 3 499 1 2", a6.toString());
69
70 Expect.equals(3, a7.x);
71 Expect.equals(407, a7.y);
72 Expect.equals(7, a7.z);
73 Expect.equals(null, a7.t);
74 Expect.equals("A 3 407 7 null", a7.toString());
75
76 Expect.equals(null, a8.x);
77 Expect.equals(null, a8.y);
78 Expect.equals(null, a8.y);
79 Expect.equals(null, a8.t);
80 Expect.equals("A null null null null", a8.toString());
81
82 Expect.isTrue(identical(a3, a9));
83
84 Expect.equals(4, a10.x);
85 Expect.equals(3, a10.y);
86 Expect.equals(2, a10.z);
87 Expect.equals(1, a10.t);
88 Expect.equals("A 4 3 2 1", a10.toString());
89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698