Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: pkg/analyzer/test/source/package_map_resolver_test.dart

Issue 914373004: Use package: URIs for files in lib (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added test and fixed URI usage Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '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_resolver.dart'; 9 import 'package:analyzer/source/package_map_resolver.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 provider.newFile(pkgFileB, 'library lib_b;'); 155 provider.newFile(pkgFileB, 'library lib_b;');
156 PackageMapUriResolver resolver = 156 PackageMapUriResolver resolver =
157 new PackageMapUriResolver(provider, <String, List<Folder>>{ 157 new PackageMapUriResolver(provider, <String, List<Folder>>{
158 'pkgA': [provider.getResource('/pkgA/lib/')], 158 'pkgA': [provider.getResource('/pkgA/lib/')],
159 'pkgB': [provider.getResource('/pkgB/lib/')] 159 'pkgB': [provider.getResource('/pkgB/lib/')]
160 }); 160 });
161 { 161 {
162 Source source = _createFileSource('/pkgA/lib/libA.dart'); 162 Source source = _createFileSource('/pkgA/lib/libA.dart');
163 Uri uri = resolver.restoreAbsolute(source); 163 Uri uri = resolver.restoreAbsolute(source);
164 expect(uri, isNotNull); 164 expect(uri, isNotNull);
165 expect(uri.path, 'package:pkgA/libA.dart'); 165 expect(uri.toString(), 'package:pkgA/libA.dart');
166 } 166 }
167 { 167 {
168 Source source = _createFileSource('/pkgB/lib/src/libB.dart'); 168 Source source = _createFileSource('/pkgB/lib/src/libB.dart');
169 Uri uri = resolver.restoreAbsolute(source); 169 Uri uri = resolver.restoreAbsolute(source);
170 expect(uri, isNotNull); 170 expect(uri, isNotNull);
171 expect(uri.path, 'package:pkgB/src/libB.dart'); 171 expect(uri.toString(), 'package:pkgB/src/libB.dart');
172 } 172 }
173 { 173 {
174 Source source = _createFileSource('/no/such/file'); 174 Source source = _createFileSource('/no/such/file');
175 Uri uri = resolver.restoreAbsolute(source); 175 Uri uri = resolver.restoreAbsolute(source);
176 expect(uri, isNull); 176 expect(uri, isNull);
177 } 177 }
178 } 178 }
179 179
180 Source _createFileSource(String path) { 180 Source _createFileSource(String path) {
181 return new NonExistingSource(path, UriKind.FILE_URI); 181 return new NonExistingSource(path, UriKind.FILE_URI);
182 } 182 }
183 } 183 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698