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 that the closed world computed from [WorldImpact]s derived from kernel | 5 // Tests that the closed world computed from [WorldImpact]s derived from kernel |
6 // is equivalent to the original computed from resolution. | 6 // is equivalent to the original computed from resolution. |
7 library dart2js.kernel.closed_world_test; | 7 library dart2js.kernel.closed_world_test; |
8 | 8 |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 import 'package:compiler/src/world.dart'; | 28 import 'package:compiler/src/world.dart'; |
29 import 'package:expect/expect.dart'; | 29 import 'package:expect/expect.dart'; |
30 import 'impact_test.dart'; | 30 import 'impact_test.dart'; |
31 import '../memory_compiler.dart'; | 31 import '../memory_compiler.dart'; |
32 import '../serialization/helper.dart'; | 32 import '../serialization/helper.dart'; |
33 import '../serialization/model_test_helper.dart'; | 33 import '../serialization/model_test_helper.dart'; |
34 | 34 |
35 const SOURCE = const { | 35 const SOURCE = const { |
36 'main.dart': ''' | 36 'main.dart': ''' |
37 main() { | 37 main() { |
38 print('Hello World!'); | 38 print(new List<String>()..add('Hello World!')); |
39 } | 39 } |
40 ''' | 40 ''' |
41 }; | 41 }; |
42 | 42 |
43 main(List<String> args) { | 43 main(List<String> args) { |
44 Arguments arguments = new Arguments.from(args); | 44 Arguments arguments = new Arguments.from(args); |
45 Uri entryPoint; | 45 Uri entryPoint; |
46 Map<String, String> memorySourceFiles; | 46 Map<String, String> memorySourceFiles; |
47 if (arguments.uri != null) { | 47 if (arguments.uri != null) { |
48 entryPoint = arguments.uri; | 48 entryPoint = arguments.uri; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 checkResolutionEnqueuers(compiler.enqueuer.resolution, enqueuer, | 101 checkResolutionEnqueuers(compiler.enqueuer.resolution, enqueuer, |
102 typeEquivalence: (DartType a, DartType b) { | 102 typeEquivalence: (DartType a, DartType b) { |
103 return areTypesEquivalent(unalias(a), unalias(b)); | 103 return areTypesEquivalent(unalias(a), unalias(b)); |
104 }, elementFilter: (Element element) { | 104 }, elementFilter: (Element element) { |
105 if (element is ConstructorElement && element.isRedirectingFactory) { | 105 if (element is ConstructorElement && element.isRedirectingFactory) { |
106 // Redirecting factory constructors are skipped in kernel. | 106 // Redirecting factory constructors are skipped in kernel. |
107 return false; | 107 return false; |
108 } | 108 } |
109 return true; | 109 return true; |
110 }, verbose: arguments.verbose); | 110 }, checkInstantiatedTypesAndClasses: false, verbose: arguments.verbose); |
111 checkClosedWorlds(compiler.closedWorld, closedWorld, | 111 checkClosedWorlds(compiler.closedWorld, closedWorld, |
112 verbose: arguments.verbose); | 112 verbose: arguments.verbose); |
113 }); | 113 }); |
114 } | 114 } |
OLD | NEW |