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 library analyzer.test.src.task.yaml_test; | 5 library analyzer.test.src.task.yaml_test; |
6 | 6 |
7 import 'package:analyzer/src/generated/source.dart'; | 7 import 'package:analyzer/src/generated/source.dart'; |
8 import 'package:analyzer/src/task/yaml.dart'; | 8 import 'package:analyzer/src/task/yaml.dart'; |
9 import 'package:analyzer/task/general.dart'; | 9 import 'package:analyzer/task/general.dart'; |
10 import 'package:analyzer/task/yaml.dart'; | 10 import 'package:analyzer/task/yaml.dart'; |
| 11 import 'package:test/test.dart'; |
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 12 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
12 import 'package:unittest/unittest.dart'; | |
13 import 'package:yaml/yaml.dart'; | 13 import 'package:yaml/yaml.dart'; |
14 | 14 |
15 import '../../utils.dart'; | 15 import '../../utils.dart'; |
16 import '../context/abstract_context.dart'; | 16 import '../context/abstract_context.dart'; |
17 | 17 |
18 main() { | 18 main() { |
19 initializeTestEnvironment(); | 19 initializeTestEnvironment(); |
20 defineReflectiveTests(ParseYamlTaskTest); | 20 defineReflectiveSuite(() { |
| 21 defineReflectiveTests(ParseYamlTaskTest); |
| 22 }); |
21 } | 23 } |
22 | 24 |
23 isInstanceOf isParseYamlTask = new isInstanceOf<ParseYamlTask>(); | 25 isInstanceOf isParseYamlTask = new isInstanceOf<ParseYamlTask>(); |
24 | 26 |
25 @reflectiveTest | 27 @reflectiveTest |
26 class ParseYamlTaskTest extends AbstractContextTest { | 28 class ParseYamlTaskTest extends AbstractContextTest { |
27 Source source; | 29 Source source; |
28 | 30 |
29 test_perform() { | 31 test_perform() { |
30 _performParseTask(r''' | 32 _performParseTask(r''' |
(...skipping 30 matching lines...) Expand all Loading... |
61 | 63 |
62 void _performParseTask(String content) { | 64 void _performParseTask(String content) { |
63 if (content == null) { | 65 if (content == null) { |
64 source = resourceProvider.getFile('/test.yaml').createSource(); | 66 source = resourceProvider.getFile('/test.yaml').createSource(); |
65 } else { | 67 } else { |
66 source = newSource('/test.yaml', content); | 68 source = newSource('/test.yaml', content); |
67 } | 69 } |
68 computeResult(source, YAML_DOCUMENT, matcher: isParseYamlTask); | 70 computeResult(source, YAML_DOCUMENT, matcher: isParseYamlTask); |
69 } | 71 } |
70 } | 72 } |
OLD | NEW |