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 library analyzer.test.source.package_map_provider_test; | 5 library analyzer.test.source.package_map_provider_test; |
6 | 6 |
7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.dart'; |
9 import 'package:analyzer/source/package_map_provider.dart'; | 9 import 'package:analyzer/source/package_map_provider.dart'; |
10 import 'package:analyzer/source/pub_package_map_provider.dart'; | 10 import 'package:analyzer/source/pub_package_map_provider.dart'; |
11 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 11 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
12 import 'package:analyzer/src/generated/sdk.dart'; | 12 import 'package:analyzer/src/generated/sdk.dart'; |
13 import 'package:test/test.dart'; | 13 import 'package:test/test.dart'; |
14 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 14 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
15 | 15 |
16 import '../utils.dart'; | |
17 | |
18 main() { | 16 main() { |
19 initializeTestEnvironment(); | |
20 defineReflectiveSuite(() { | 17 defineReflectiveSuite(() { |
21 defineReflectiveTests(PubPackageMapProviderTest); | 18 defineReflectiveTests(PubPackageMapProviderTest); |
22 }); | 19 }); |
23 } | 20 } |
24 | 21 |
25 @reflectiveTest | 22 @reflectiveTest |
26 class PubPackageMapProviderTest { | 23 class PubPackageMapProviderTest { |
27 static const String projectPath = '/path/to/project'; | 24 static const String projectPath = '/path/to/project'; |
28 | 25 |
29 DartSdk sdk; | 26 DartSdk sdk; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 resourceProvider.newFolder(projectPath); | 131 resourceProvider.newFolder(projectPath); |
135 resourceProvider.newFile(dependencyPath, 'contents'); | 132 resourceProvider.newFile(dependencyPath, 'contents'); |
136 Set<String> dependencies = parsePackageMap({ | 133 Set<String> dependencies = parsePackageMap({ |
137 'packages': {}, | 134 'packages': {}, |
138 'input_files': [relativeDependencyPath] | 135 'input_files': [relativeDependencyPath] |
139 }).dependencies; | 136 }).dependencies; |
140 expect(dependencies, hasLength(1)); | 137 expect(dependencies, hasLength(1)); |
141 expect(dependencies, contains(dependencyPath)); | 138 expect(dependencies, contains(dependencyPath)); |
142 } | 139 } |
143 } | 140 } |
OLD | NEW |