OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Tests of reading and writing to variables. | 5 // Tests of reading and writing to variables. |
6 | 6 |
7 import 'expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 | 8 |
9 test0() { | 9 test0() { |
10 var x0 = 0, x1; | 10 var x0 = 0, x1; |
11 Expect.isTrue(x0 == 0); | 11 Expect.isTrue(x0 == 0); |
12 Expect.isTrue(x1 == null); | 12 Expect.isTrue(x1 == null); |
13 x0 = 1; | 13 x0 = 1; |
14 Expect.isTrue(x0 == 1); | 14 Expect.isTrue(x0 == 1); |
15 Expect.isTrue((x0 = 2) == 2); | 15 Expect.isTrue((x0 = 2) == 2); |
16 Expect.isTrue(x0 == 2); | 16 Expect.isTrue(x0 == 2); |
17 } | 17 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 Expect.isTrue((d.x6 = 2) == 2); | 55 Expect.isTrue((d.x6 = 2) == 2); |
56 Expect.isTrue(d.x6 == 2); | 56 Expect.isTrue(d.x6 == 2); |
57 } | 57 } |
58 | 58 |
59 main() { | 59 main() { |
60 test0(); | 60 test0(); |
61 test1(); | 61 test1(); |
62 test3(); | 62 test3(); |
63 test4(); | 63 test4(); |
64 } | 64 } |
OLD | NEW |