OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import "package:async_helper/async_helper.dart"; | 6 import "package:async_helper/async_helper.dart"; |
7 import "compiler_helper.dart"; | 7 import "compiler_helper.dart"; |
8 | 8 |
9 const String TEST = "main() => [];"; | 9 const String TEST = "main() => [];"; |
10 | 10 |
11 const String DEFAULT_CORELIB_WITH_LIST = r''' | 11 const Map<String, String> DEFAULT_CORELIB_WITH_LIST = const <String, String>{ |
12 class Object { | 12 'Object': 'class Object { Object(); }', |
13 Object(); | 13 'bool': 'class bool {}', |
14 } | 14 'List': 'abstract class List {}', |
15 class bool {} | 15 'num': 'class num {}', |
16 abstract class List {} | 16 'int': 'class int {}', |
17 class num {} | 17 'double': 'class double {}', |
18 class int {} | 18 'String': 'class String {}', |
19 class double {} | 19 'Function': 'class Function {}', |
20 class String {} | 20 'Null': 'class Null {}', |
21 class Function {} | 21 'Type': 'class Type {}', |
22 class Null {} | 22 'Map': 'class Map {}', |
23 class Type {} | 23 'StackTrace': 'class StackTrace {}', |
24 class Map {} | 24 'identical': 'identical(a, b) => true;', |
25 class StackTrace {} | 25 'proxy': 'const proxy = 0;', |
26 identical(a, b) => true; | 26 }; |
27 const proxy = 0; | |
28 '''; | |
29 | 27 |
30 main() { | 28 main() { |
31 asyncTest(() => compileAll(TEST, coreSource: DEFAULT_CORELIB_WITH_LIST). | 29 asyncTest(() => compileAll(TEST, coreSource: DEFAULT_CORELIB_WITH_LIST). |
32 then((generated) { | 30 then((generated) { |
33 return MockCompiler.create((MockCompiler compiler) { | 31 return MockCompiler.create((MockCompiler compiler) { |
34 var backend = compiler.backend; | 32 var backend = compiler.backend; |
35 | 33 |
36 // Make sure no class is emitted. | 34 // Make sure no class is emitted. |
37 Expect.isFalse(generated.contains(backend.emitter.finishClassesName)); | 35 Expect.isFalse(generated.contains(backend.emitter.finishClassesName)); |
38 }); | 36 }); |
39 })); | 37 })); |
40 } | 38 } |
OLD | NEW |