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

Side by Side Diff: pkg/analysis_server/test/physical_resource_provider_test.dart

Issue 367453003: Handle relative paths in the output of "pub list-package-dirs". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
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.physical.resource.provider; 5 library test.physical.resource.provider;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 9
10 import 'package:analysis_server/src/resource.dart'; 10 import 'package:analysis_server/src/resource.dart';
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 while (true) { 235 while (true) {
236 Resource grandParent = parent.parent; 236 Resource grandParent = parent.parent;
237 if (grandParent == null) { 237 if (grandParent == null) {
238 break; 238 break;
239 } 239 }
240 expect(grandParent, new isInstanceOf<Folder>()); 240 expect(grandParent, new isInstanceOf<Folder>());
241 expect(grandParent.path.length, lessThan(parent.path.length)); 241 expect(grandParent.path.length, lessThan(parent.path.length));
242 parent = grandParent; 242 parent = grandParent;
243 } 243 }
244 }); 244 });
245
246 test('canonicalizePath', () {
247 String path2 = join(tempPath, 'folder2');
248 String path3 = join(tempPath, 'folder3');
249 expect(folder.canonicalizePath('baz'), equals(join(path, 'baz')));
250 expect(folder.canonicalizePath(path2), equals(path2));
251 expect(folder.canonicalizePath('../folder2'), equals(path2));
scheglov 2014/07/01 15:33:38 Replace '../folder2' with join?
Paul Berry 2014/07/01 16:31:41 Done.
252 expect(folder.canonicalizePath(join(path2, '..', 'folder3')), equals(p ath3));
253 expect(folder.canonicalizePath(join('.', 'baz')), equals(join(path, 'b az')));
254 expect(folder.canonicalizePath(join(path2, '.', 'baz')), equals(join(p ath2, 'baz')));
255 });
245 }); 256 });
246 }); 257 });
247 } 258 }
248 259
249 var _isFile = new isInstanceOf<File>(); 260 var _isFile = new isInstanceOf<File>();
250 var _isFolder = new isInstanceOf<Folder>(); 261 var _isFolder = new isInstanceOf<Folder>();
251 var _isMemoryResourceException = new isInstanceOf<MemoryResourceException>(); 262 var _isMemoryResourceException = new isInstanceOf<MemoryResourceException>();
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/package_map_provider_test.dart ('k') | pkg/analysis_server/test/resource_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698