| 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 test.source.package_map_resolver; | 5 library test.source.package_map_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 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'; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 new _PackageMapUriResolverTest().test_resolve_package_notInMap(); | 48 new _PackageMapUriResolverTest().test_resolve_package_notInMap(); |
| 49 }); | 49 }); |
| 50 test('restoreAbsolute_OK', () { | 50 test('restoreAbsolute_OK', () { |
| 51 new _PackageMapUriResolverTest().test_restoreAbsolute(); | 51 new _PackageMapUriResolverTest().test_restoreAbsolute(); |
| 52 }); | 52 }); |
| 53 }); | 53 }); |
| 54 } | 54 } |
| 55 | 55 |
| 56 | 56 |
| 57 class _PackageMapUriResolverTest { | 57 class _PackageMapUriResolverTest { |
| 58 static HashMap EMPTY_MAP = new HashMap<String, List<Folder>>(); | 58 static const Map EMPTY_MAP = const <String, List<Folder>>{}; |
| 59 MemoryResourceProvider provider = new MemoryResourceProvider(); | 59 MemoryResourceProvider provider = new MemoryResourceProvider(); |
| 60 | 60 |
| 61 void test_isPackageUri() { | 61 void test_isPackageUri() { |
| 62 Uri uri = Uri.parse('package:test/test.dart'); | 62 Uri uri = Uri.parse('package:test/test.dart'); |
| 63 expect(uri.scheme, 'package'); | 63 expect(uri.scheme, 'package'); |
| 64 expect(PackageMapUriResolver.isPackageUri(uri), isTrue); | 64 expect(PackageMapUriResolver.isPackageUri(uri), isTrue); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void test_isPackageUri_null_scheme() { | 67 void test_isPackageUri_null_scheme() { |
| 68 Uri uri = Uri.parse('foo.dart'); | 68 Uri uri = Uri.parse('foo.dart'); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 Source source = _createFileSource('/no/such/file'); | 196 Source source = _createFileSource('/no/such/file'); |
| 197 Uri uri = resolver.restoreAbsolute(source); | 197 Uri uri = resolver.restoreAbsolute(source); |
| 198 expect(uri, isNull); | 198 expect(uri, isNull); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 Source _createFileSource(String path) { | 202 Source _createFileSource(String path) { |
| 203 return new NonExistingSource(path, UriKind.FILE_URI); | 203 return new NonExistingSource(path, UriKind.FILE_URI); |
| 204 } | 204 } |
| 205 } | 205 } |
| OLD | NEW |