OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 that a static configuration can be loaded in pieces, even with | 5 /// Tests that a static configuration can be loaded in pieces, even with |
6 /// deferred imports. | 6 /// deferred imports. |
7 library smoke.test.static_in_pieces_test; | 7 library smoke.test.static_in_pieces_test; |
8 | 8 |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 import 'package:smoke/smoke.dart' show Declaration, PROPERTY, METHOD; | 10 import 'package:smoke/smoke.dart' show Declaration, PROPERTY, METHOD; |
11 import 'package:smoke/static.dart' show useGeneratedCode, StaticConfiguration; | 11 import 'package:smoke/static.dart' show useGeneratedCode, StaticConfiguration; |
12 import 'piece1.dart' as p1; | 12 import 'piece1.dart' as p1; |
13 import 'piece2.dart' deferred as p2; | 13 import 'piece2.dart' deferred as p2; |
14 import 'common.dart' as smoke_0; | 14 import 'common.dart' as smoke_0; |
15 import 'common.dart' as common show main; | 15 import 'common.dart' as common show main; |
16 | 16 |
17 abstract class _M0 {} // C & A | 17 abstract class _M0 {} // C & A |
18 | 18 |
19 final configuration = new StaticConfiguration( | 19 final configuration = new StaticConfiguration( |
20 checkedMode: false, | 20 checkedMode: false, |
21 getters: { | 21 getters: { |
22 #i: (o) => o.i, | 22 #i: (o) => o.i, |
23 #inc0: (o) => o.inc0, | 23 #inc0: (o) => o.inc0, |
24 #inc1: (o) => o.inc1, | 24 #inc1: (o) => o.inc1, |
25 #inc2: (o) => o.inc2, | 25 #inc2: (o) => o.inc2, |
| 26 #toString: (o) => o.toString, |
26 }, | 27 }, |
27 setters: { | 28 setters: { |
28 #i: (o, v) { o.i = v; }, | 29 #i: (o, v) { o.i = v; }, |
29 }, | 30 }, |
30 parents: { | 31 parents: { |
31 smoke_0.AnnotB: smoke_0.Annot, | 32 smoke_0.AnnotB: smoke_0.Annot, |
32 smoke_0.D: _M0, | 33 smoke_0.D: _M0, |
33 smoke_0.E2: smoke_0.E, | 34 smoke_0.E2: smoke_0.E, |
34 smoke_0.F2: smoke_0.F, | 35 smoke_0.F2: smoke_0.F, |
35 _M0: smoke_0.C, | 36 _M0: smoke_0.C, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 configuration.addAll(p1.configuration); | 90 configuration.addAll(p1.configuration); |
90 expect(configuration.getters[#j], isNotNull); | 91 expect(configuration.getters[#j], isNotNull); |
91 | 92 |
92 p2.loadLibrary().then((_) { | 93 p2.loadLibrary().then((_) { |
93 expect(configuration.names[#i], isNull); | 94 expect(configuration.names[#i], isNull); |
94 configuration.addAll(p2.configuration); | 95 configuration.addAll(p2.configuration); |
95 expect(configuration.names[#i], 'i'); | 96 expect(configuration.names[#i], 'i'); |
96 common.main(); | 97 common.main(); |
97 }); | 98 }); |
98 } | 99 } |
OLD | NEW |