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 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 'memory_compiler.dart'; | 7 import 'memory_compiler.dart'; |
8 | 8 |
9 const MEMORY_SOURCE_FILES = const { | 9 const MEMORY_SOURCE_FILES = const { |
10 'main.dart': ''' | 10 'main.dart': ''' |
(...skipping 12 matching lines...) Expand all Loading... |
23 ''', | 23 ''', |
24 }; | 24 }; |
25 | 25 |
26 main() { | 26 main() { |
27 asyncTest(() async { | 27 asyncTest(() async { |
28 var result = await runCompiler( | 28 var result = await runCompiler( |
29 memorySourceFiles: MEMORY_SOURCE_FILES, | 29 memorySourceFiles: MEMORY_SOURCE_FILES, |
30 options: ['--trust-type-annotations']); | 30 options: ['--trust-type-annotations']); |
31 var compiler = result.compiler; | 31 var compiler = result.compiler; |
32 var element = compiler.mainFunction; | 32 var element = compiler.mainFunction; |
33 var code = compiler.backend.assembleCode(element); | 33 var code = compiler.backend.getGeneratedCode(element); |
34 Expect.isTrue(code.contains('+'), code); | 34 Expect.isTrue(code.contains('+'), code); |
35 }); | 35 }); |
36 } | 36 } |
OLD | NEW |