Chromium Code Reviews| 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.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 Loading... | |
| 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>(); |
| OLD | NEW |