Index: pkg/analyzer/test/source/package_map_provider_test.dart |
diff --git a/pkg/analyzer/test/source/package_map_provider_test.dart b/pkg/analyzer/test/source/package_map_provider_test.dart |
index ea7987b84df1bcd6c410a2b53f337181ed3c523a..af5bedf26cc56779cc53be2612d89efb45b58ac8 100644 |
--- a/pkg/analyzer/test/source/package_map_provider_test.dart |
+++ b/pkg/analyzer/test/source/package_map_provider_test.dart |
@@ -11,8 +11,10 @@ import 'package:analyzer/source/pub_package_map_provider.dart'; |
import 'package:analyzer/src/generated/sdk_io.dart'; |
import 'package:unittest/unittest.dart'; |
+import '../utils.dart'; |
+ |
main() { |
- groupSep = ' | '; |
+ initializeTestEnvironment(); |
group('PubPackageMapProvider', () { |
group('parsePackageMap', () { |
@@ -36,8 +38,9 @@ main() { |
String packageName = 'foo'; |
String folderPath = '/path/to/folder'; |
resourceProvider.newFolder(folderPath); |
- Map<String, List<Folder>> result = |
- parsePackageMap({'packages': {packageName: folderPath}}).packageMap; |
+ Map<String, List<Folder>> result = parsePackageMap({ |
+ 'packages': {packageName: folderPath} |
+ }).packageMap; |
expect(result, hasLength(1)); |
expect(result.keys, contains(packageName)); |
expect(result[packageName], hasLength(1)); |
@@ -48,8 +51,9 @@ main() { |
test("don't ignore nonexistent folder", () { |
String packageName = 'foo'; |
String folderPath = '/path/to/folder'; |
- Map<String, List<Folder>> result = |
- parsePackageMap({'packages': {packageName: folderPath}}).packageMap; |
+ Map<String, List<Folder>> result = parsePackageMap({ |
+ 'packages': {packageName: folderPath} |
+ }).packageMap; |
expect(result, hasLength(1)); |
expect(result.keys, contains(packageName)); |
expect(result[packageName], hasLength(1)); |
@@ -63,8 +67,11 @@ main() { |
String folderPath2 = '/path/to/folder2'; |
resourceProvider.newFolder(folderPath1); |
resourceProvider.newFolder(folderPath2); |
- Map<String, List<Folder>> result = parsePackageMap( |
- {'packages': {packageName: [folderPath1, folderPath2]}}).packageMap; |
+ Map<String, List<Folder>> result = parsePackageMap({ |
+ 'packages': { |
+ packageName: [folderPath1, folderPath2] |
+ } |
+ }).packageMap; |
expect(result, hasLength(1)); |
expect(result.keys, contains(packageName)); |
expect(result[packageName], hasLength(2)); |
@@ -79,8 +86,10 @@ main() { |
String path2 = '/path/to/folder2/pubspec.lock'; |
resourceProvider.newFile(path1, '...'); |
resourceProvider.newFile(path2, '...'); |
- Set<String> dependencies = parsePackageMap( |
- {'packages': {}, 'input_files': [path1, path2]}).dependencies; |
+ Set<String> dependencies = parsePackageMap({ |
+ 'packages': {}, |
+ 'input_files': [path1, path2] |
+ }).dependencies; |
expect(dependencies, hasLength(2)); |
expect(dependencies, contains(path1)); |
expect(dependencies, contains(path2)); |
@@ -92,8 +101,11 @@ main() { |
String packageName = 'foo'; |
resourceProvider.newFolder(projectPath); |
resourceProvider.newFolder(packagePath); |
- Map<String, List<Folder>> result = parsePackageMap( |
- {'packages': {packageName: [relativePackagePath]}}).packageMap; |
+ Map<String, List<Folder>> result = parsePackageMap({ |
+ 'packages': { |
+ packageName: [relativePackagePath] |
+ } |
+ }).packageMap; |
expect(result[packageName][0].path, equals(packagePath)); |
}); |