OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.source.caching_pub_package_map_provider; | 5 library test.source.caching_pub_package_map_provider; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:core'; | 8 import 'dart:core'; |
9 import 'dart:io' as io; | 9 import 'dart:io' as io; |
10 | 10 |
11 import 'package:analysis_server/src/source/caching_pub_package_map_provider.dart
'; | 11 import 'package:analysis_server/src/source/caching_pub_package_map_provider.dart
'; |
12 import 'package:analyzer/file_system/file_system.dart'; | 12 import 'package:analyzer/file_system/file_system.dart'; |
13 import 'package:analyzer/file_system/memory_file_system.dart'; | 13 import 'package:analyzer/file_system/memory_file_system.dart'; |
14 import 'package:analyzer/source/package_map_provider.dart'; | 14 import 'package:analyzer/source/package_map_provider.dart'; |
15 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 15 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
16 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
17 import 'package:test/test.dart'; | 17 import 'package:test/test.dart'; |
18 | 18 |
19 import '../utils.dart'; | |
20 | |
21 main() { | 19 main() { |
22 initializeTestEnvironment(); | |
23 | |
24 group('CachingPubPackageMapProvider', () { | 20 group('CachingPubPackageMapProvider', () { |
25 MemoryResourceProvider resProvider; | 21 MemoryResourceProvider resProvider; |
26 _MockPubListRunner mockRunner; | 22 _MockPubListRunner mockRunner; |
27 bool writeFileException; | 23 bool writeFileException; |
28 | 24 |
29 Map result1 = { | 25 Map result1 = { |
30 'packages': {'foo': '/tmp/proj1/packages/foo'}, | 26 'packages': {'foo': '/tmp/proj1/packages/foo'}, |
31 'input_files': ['/tmp/proj1/pubspec.yaml'] | 27 'input_files': ['/tmp/proj1/pubspec.yaml'] |
32 }; | 28 }; |
33 | 29 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 provider.newFolder(path); | 391 provider.newFolder(path); |
396 } | 392 } |
397 int fileCount = _filePaths.length; | 393 int fileCount = _filePaths.length; |
398 for (int fileIndex = 0; fileIndex < fileCount; ++fileIndex) { | 394 for (int fileIndex = 0; fileIndex < fileCount; ++fileIndex) { |
399 String path = _filePaths[fileIndex]; | 395 String path = _filePaths[fileIndex]; |
400 TimestampedData content = _fileContents[fileIndex]; | 396 TimestampedData content = _fileContents[fileIndex]; |
401 provider.newFile(path, content.data, content.modificationTime); | 397 provider.newFile(path, content.data, content.modificationTime); |
402 } | 398 } |
403 } | 399 } |
404 } | 400 } |
OLD | NEW |