| 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_file_system; | 5 library test.physical_file_system; |
| 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:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 expect(folder == folder2, isTrue); | 208 expect(folder == folder2, isTrue); |
| 209 }); | 209 }); |
| 210 | 210 |
| 211 test('equality: different paths', () { | 211 test('equality: different paths', () { |
| 212 String path2 = join(tempPath, 'folder2'); | 212 String path2 = join(tempPath, 'folder2'); |
| 213 new io.Directory(path2).createSync(); | 213 new io.Directory(path2).createSync(); |
| 214 Folder folder2 = PhysicalResourceProvider.INSTANCE.getResource(path2); | 214 Folder folder2 = PhysicalResourceProvider.INSTANCE.getResource(path2); |
| 215 expect(folder == folder2, isFalse); | 215 expect(folder == folder2, isFalse); |
| 216 }); | 216 }); |
| 217 | 217 |
| 218 test('contains', () { |
| 219 expect(folder.contains(join(path, 'aaa.txt')), isTrue); |
| 220 expect(folder.contains(join(path, 'aaa', 'bbb.txt')), isTrue); |
| 221 expect(folder.contains(join(tempPath, 'baz.txt')), isFalse); |
| 222 expect(folder.contains(path), isFalse); |
| 223 }); |
| 224 |
| 218 group('getChild', () { | 225 group('getChild', () { |
| 219 test('does not exist', () { | 226 test('does not exist', () { |
| 220 var child = folder.getChild('no-such-resource'); | 227 var child = folder.getChild('no-such-resource'); |
| 221 expect(child, isNotNull); | 228 expect(child, isNotNull); |
| 222 expect(child.exists, isFalse); | 229 expect(child.exists, isFalse); |
| 223 }); | 230 }); |
| 224 | 231 |
| 225 test('file', () { | 232 test('file', () { |
| 226 new io.File(join(path, 'myFile')).createSync(); | 233 new io.File(join(path, 'myFile')).createSync(); |
| 227 var child = folder.getChild('myFile'); | 234 var child = folder.getChild('myFile'); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 expect(folder.canonicalizePath('baz'), equals(join(path, 'baz'))); | 293 expect(folder.canonicalizePath('baz'), equals(join(path, 'baz'))); |
| 287 expect(folder.canonicalizePath(path2), equals(path2)); | 294 expect(folder.canonicalizePath(path2), equals(path2)); |
| 288 expect(folder.canonicalizePath(join('..', 'folder2')), equals(path2)); | 295 expect(folder.canonicalizePath(join('..', 'folder2')), equals(path2)); |
| 289 expect(folder.canonicalizePath(join(path2, '..', 'folder3')), equals(p
ath3)); | 296 expect(folder.canonicalizePath(join(path2, '..', 'folder3')), equals(p
ath3)); |
| 290 expect(folder.canonicalizePath(join('.', 'baz')), equals(join(path, 'b
az'))); | 297 expect(folder.canonicalizePath(join('.', 'baz')), equals(join(path, 'b
az'))); |
| 291 expect(folder.canonicalizePath(join(path2, '.', 'baz')), equals(join(p
ath2, 'baz'))); | 298 expect(folder.canonicalizePath(join(path2, '.', 'baz')), equals(join(p
ath2, 'baz'))); |
| 292 }); | 299 }); |
| 293 }); | 300 }); |
| 294 }); | 301 }); |
| 295 } | 302 } |
| OLD | NEW |