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 analyzer.test.generated.test.generated.source_factory; | 5 library analyzer.test.generated.test.generated.source_factory; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
10 import 'package:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
11 import 'package:analyzer/source/package_map_resolver.dart'; | 11 import 'package:analyzer/source/package_map_resolver.dart'; |
12 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine, Logger; | 12 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine, Logger; |
13 import 'package:analyzer/src/generated/java_engine_io.dart'; | 13 import 'package:analyzer/src/generated/java_engine_io.dart'; |
14 import 'package:analyzer/src/generated/source.dart'; | 14 import 'package:analyzer/src/generated/source.dart'; |
15 import 'package:analyzer/src/generated/source_io.dart'; | 15 import 'package:analyzer/src/generated/source_io.dart'; |
16 import 'package:analyzer/src/generated/utilities_dart.dart' as utils; | 16 import 'package:analyzer/src/generated/utilities_dart.dart' as utils; |
17 import 'package:analyzer/src/source/source_resource.dart'; | 17 import 'package:analyzer/src/source/source_resource.dart'; |
18 import 'package:package_config/packages.dart'; | 18 import 'package:package_config/packages.dart'; |
19 import 'package:package_config/packages_file.dart' as pkgfile show parse; | 19 import 'package:package_config/packages_file.dart' as pkgfile show parse; |
20 import 'package:package_config/src/packages_impl.dart'; | 20 import 'package:package_config/src/packages_impl.dart'; |
21 import 'package:path/path.dart'; | 21 import 'package:path/path.dart'; |
| 22 import 'package:test/test.dart'; |
22 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 23 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
23 import 'package:unittest/unittest.dart'; | |
24 | 24 |
25 import '../utils.dart'; | 25 import '../utils.dart'; |
26 import 'test_support.dart'; | 26 import 'test_support.dart'; |
27 | 27 |
28 main() { | 28 main() { |
29 initializeTestEnvironment(); | 29 initializeTestEnvironment(); |
30 defineReflectiveTests(SourceFactoryTest); | |
31 runPackageMapTests(); | 30 runPackageMapTests(); |
| 31 defineReflectiveSuite(() { |
| 32 defineReflectiveTests(SourceFactoryTest); |
| 33 }); |
32 } | 34 } |
33 | 35 |
34 Source createSource({String path, String uri}) => | 36 Source createSource({String path, String uri}) => |
35 //TODO(pquitslund): find some way to pass an actual URI into source creation | 37 //TODO(pquitslund): find some way to pass an actual URI into source creation |
36 new MemoryResourceProvider() | 38 new MemoryResourceProvider() |
37 .getFile(path) | 39 .getFile(path) |
38 .createSource(uri != null ? Uri.parse(uri) : null); | 40 .createSource(uri != null ? Uri.parse(uri) : null); |
39 | 41 |
40 void runPackageMapTests() { | 42 void runPackageMapTests() { |
41 MemoryResourceProvider resourceProvider = new MemoryResourceProvider(); | 43 MemoryResourceProvider resourceProvider = new MemoryResourceProvider(); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding); | 361 UriResolver_SourceFactoryTest_test_fromEncoding_valid(this.encoding); |
360 | 362 |
361 @override | 363 @override |
362 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 364 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
363 if (uri.toString() == encoding) { | 365 if (uri.toString() == encoding) { |
364 return new TestSource(); | 366 return new TestSource(); |
365 } | 367 } |
366 return null; | 368 return null; |
367 } | 369 } |
368 } | 370 } |
OLD | NEW |