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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library fasta.test.compile_test; | 5 library fasta.test.compile_test; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show Future; |
8 Future; | |
9 | 8 |
10 import 'package:front_end/src/fasta/testing/suite.dart'; | 9 import 'package:front_end/src/fasta/testing/suite.dart'; |
11 | 10 |
12 import 'package:front_end/src/fasta/testing/kernel_chain.dart' show | 11 import 'package:front_end/src/fasta/testing/kernel_chain.dart' |
13 MatchExpectation; | 12 show MatchExpectation; |
14 | 13 |
15 Future<FeContext> createContext( | 14 Future<FastaContext> createContext( |
16 Chain suite, Map<String, String> environment) async { | 15 Chain suite, Map<String, String> environment) async { |
17 environment[ENABLE_FULL_COMPILE] = ""; | 16 environment[ENABLE_FULL_COMPILE] = ""; |
18 environment[AST_KIND_INDEX] = "${AstKind.Kernel.index}"; | 17 environment[AST_KIND_INDEX] = "${AstKind.Kernel.index}"; |
19 FeContext context = | 18 FastaContext context = await FastaContext.create(suite, environment); |
20 await TestContext.create(suite, environment, FeContext.create); | |
21 int index; | 19 int index; |
22 for (int i = 0; i < context.steps.length; i++) { | 20 for (int i = 0; i < context.steps.length; i++) { |
23 if (context.steps[i] is MatchExpectation) { | 21 if (context.steps[i] is MatchExpectation) { |
24 index = i; | 22 index = i; |
25 break; | 23 break; |
26 } | 24 } |
27 } | 25 } |
28 context.steps.removeAt(index); | 26 context.steps.removeAt(index); |
29 return context; | 27 return context; |
30 } | 28 } |
31 | 29 |
32 main(List<String> arguments) => runMe(arguments, createContext); | 30 main(List<String> arguments) => runMe(arguments, createContext); |
OLD | NEW |