OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(jakemac): swap this to @TestOn('pub-serve') once | 5 // TODO(jakemac): swap this to @TestOn('pub-serve') once |
6 // https://github.com/dart-lang/test/issues/388 is completed. | 6 // https://github.com/dart-lang/test/issues/388 is completed. |
7 @TestOn('!js') | 7 @TestOn('!js') |
8 library initialize.initializer_super_test; | 8 library initialize.initializer_super_test; |
9 | 9 |
10 import 'package:initialize/src/initialize_tracker.dart'; | 10 import 'package:initialize/src/initialize_tracker.dart'; |
11 import 'package:initialize/initialize.dart'; | 11 import 'package:initialize/initialize.dart'; |
12 import 'package:test/test.dart'; | 12 import 'package:test/test.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 // Run all initializers. | 15 // Run all initializers. |
16 return run().then((_) { | 16 return run().then((_) { |
17 test('annotations are seen in post-order with superclasses first', () { | 17 test('annotations are seen in post-order with superclasses first', () { |
18 var expectedNames = [A, C, B, E, D,]; | 18 var expectedNames = [ |
| 19 A, |
| 20 C, |
| 21 B, |
| 22 E, |
| 23 D, |
| 24 ]; |
19 expect(InitializeTracker.seen, expectedNames); | 25 expect(InitializeTracker.seen, expectedNames); |
20 }); | 26 }); |
21 }); | 27 }); |
22 } | 28 } |
23 | 29 |
24 @initializeTracker | 30 @initializeTracker |
25 class D extends E {} | 31 class D extends E {} |
26 | 32 |
27 @initializeTracker | 33 @initializeTracker |
28 class E extends B {} | 34 class E extends B {} |
29 | 35 |
30 @initializeTracker | 36 @initializeTracker |
31 class B extends C {} | 37 class B extends C {} |
32 | 38 |
33 @initializeTracker | 39 @initializeTracker |
34 class C extends A {} | 40 class C extends A {} |
35 | 41 |
36 @initializeTracker | 42 @initializeTracker |
37 class A {} | 43 class A {} |
OLD | NEW |