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 block scoping. | 5 // Tests of block scoping. |
6 | 6 |
7 import 'expect.dart'; | 7 import 'package:expect/expect.dart'; |
8 | 8 |
9 bool oracle() => true; | 9 bool oracle() => true; |
10 | 10 |
11 test0() { | 11 test0() { |
12 var x = 'outer', y = x; | 12 var x = 'outer', y = x; |
13 Expect.isTrue(x == 'outer'); | 13 Expect.isTrue(x == 'outer'); |
14 Expect.isTrue(y == 'outer'); | 14 Expect.isTrue(y == 'outer'); |
15 { var x = 'inner'; | 15 { var x = 'inner'; |
16 Expect.isTrue(x == 'inner'); | 16 Expect.isTrue(x == 'inner'); |
17 Expect.isTrue(y == 'outer'); | 17 Expect.isTrue(y == 'outer'); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } else { | 50 } else { |
51 Expect.isTrue(false); | 51 Expect.isTrue(false); |
52 } | 52 } |
53 Expect.isTrue(x == 'toplevel'); | 53 Expect.isTrue(x == 'toplevel'); |
54 Expect.isTrue(y == 'outer'); | 54 Expect.isTrue(y == 'outer'); |
55 } | 55 } |
56 | 56 |
57 main() { | 57 main() { |
58 test0(); | 58 test0(); |
59 test1(); | 59 test1(); |
60 } | 60 } |
OLD | NEW |