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

Side by Side Diff: tests/kernel/unsorted/load_store_test.dart

Issue 2451623006: Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork." (Closed)
Patch Set: Fix Created 4 years, 1 month 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
« no previous file with comments | « tests/kernel/unsorted/let_test.dart ('k') | tests/kernel/unsorted/local_function_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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 // Tests of reading and writing to variables.
6
7 import 'expect.dart';
8
9 test0() {
10 var x0 = 0, x1;
11 Expect.isTrue(x0 == 0);
12 Expect.isTrue(x1 == null);
13 x0 = 1;
14 Expect.isTrue(x0 == 1);
15 Expect.isTrue((x0 = 2) == 2);
16 Expect.isTrue(x0 == 2);
17 }
18
19 var x2 = 0, x3;
20
21 test1() {
22 Expect.isTrue(x2 == 0);
23 Expect.isTrue(x3 == null);
24 x2 = 1;
25 Expect.isTrue(x2 == 1);
26 Expect.isTrue((x2 = 2) == 2);
27 Expect.isTrue(x2 == 2);
28 }
29
30 class C {
31 static var x4 = 0;
32 static var x5;
33 }
34
35 test3() {
36 Expect.isTrue(C.x4 == 0);
37 Expect.isTrue(C.x5 == null);
38 C.x4 = 1;
39 Expect.isTrue(C.x4 == 1);
40 Expect.isTrue((C.x4 = 2) == 2);
41 Expect.isTrue(C.x4 == 2);
42 }
43
44 class D {
45 var x6 = 0;
46 var x7;
47 }
48
49 test4() {
50 var d = new D();
51 Expect.isTrue(d.x6 == 0);
52 Expect.isTrue(d.x7 == null);
53 d.x6 = 1;
54 Expect.isTrue(d.x6 == 1);
55 Expect.isTrue((d.x6 = 2) == 2);
56 Expect.isTrue(d.x6 == 2);
57 }
58
59 main() {
60 test0();
61 test1();
62 test3();
63 test4();
64 }
OLDNEW
« no previous file with comments | « tests/kernel/unsorted/let_test.dart ('k') | tests/kernel/unsorted/local_function_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698