| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Directory listing test. | 5 // Directory listing test. |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import "dart:async"; | 8 import "dart:async"; |
| 9 import "dart:io"; | 9 import "dart:io"; |
| 10 import "dart:isolate"; | 10 import "dart:isolate"; |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 }); | 397 }); |
| 398 } | 398 } |
| 399 | 399 |
| 400 static void testCurrent() { | 400 static void testCurrent() { |
| 401 Directory current = Directory.current; | 401 Directory current = Directory.current; |
| 402 if (Platform.operatingSystem != "windows") { | 402 if (Platform.operatingSystem != "windows") { |
| 403 Expect.equals("/", current.path.substring(0, 1)); | 403 Expect.equals("/", current.path.substring(0, 1)); |
| 404 } | 404 } |
| 405 } | 405 } |
| 406 | 406 |
| 407 static void testFromPath() { | 407 static void testEquals() { |
| 408 var name = new File('.').fullPathSync(); | 408 var name = new File('.').fullPathSync(); |
| 409 Directory current1 = new Directory(name); | 409 Directory current1 = new Directory(name); |
| 410 var path = new Path(name); | 410 Directory current2 = new Directory(name); |
| 411 Directory current2 = new Directory.fromPath(path); | |
| 412 Expect.equals(current1.path, current2.path); | 411 Expect.equals(current1.path, current2.path); |
| 413 Expect.isTrue(current1.existsSync()); | 412 Expect.isTrue(current1.existsSync()); |
| 414 } | 413 } |
| 415 | 414 |
| 416 static void testMain() { | 415 static void testMain() { |
| 417 testListing(); | 416 testListing(); |
| 418 testListingTailingPaths(); | 417 testListingTailingPaths(); |
| 419 testListNonExistent(); | 418 testListNonExistent(); |
| 420 testListTooLongName(); | 419 testListTooLongName(); |
| 421 testDeleteNonExistent(); | 420 testDeleteNonExistent(); |
| 422 testDeleteTooLongName(); | 421 testDeleteTooLongName(); |
| 423 testDeleteNonExistentSync(); | 422 testDeleteNonExistentSync(); |
| 424 testDeleteTooLongNameSync(); | 423 testDeleteTooLongNameSync(); |
| 425 testExistsCreateDelete(); | 424 testExistsCreateDelete(); |
| 426 testExistsCreateDeleteSync(); | 425 testExistsCreateDeleteSync(); |
| 427 testDeleteLinkSync(); | 426 testDeleteLinkSync(); |
| 428 testDeleteLinkAsFileSync(); | 427 testDeleteLinkAsFileSync(); |
| 429 testDeleteBrokenLinkAsFileSync(); | 428 testDeleteBrokenLinkAsFileSync(); |
| 430 testListBrokenLinkSync(); | 429 testListBrokenLinkSync(); |
| 431 testListLinkSync(); | 430 testListLinkSync(); |
| 432 testCreateTemp(); | 431 testCreateTemp(); |
| 433 testCreateDeleteTemp(); | 432 testCreateDeleteTemp(); |
| 434 testCurrent(); | 433 testCurrent(); |
| 435 testFromPath(); | 434 testEquals(); |
| 436 } | 435 } |
| 437 } | 436 } |
| 438 | 437 |
| 439 | 438 |
| 440 class NestedTempDirectoryTest { | 439 class NestedTempDirectoryTest { |
| 441 List<Directory> createdDirectories; | 440 List<Directory> createdDirectories; |
| 442 Directory current; | 441 Directory current; |
| 443 | 442 |
| 444 NestedTempDirectoryTest.run() | 443 NestedTempDirectoryTest.run() |
| 445 : createdDirectories = new List<Directory>() { | 444 : createdDirectories = new List<Directory>() { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 testCreateTempErrorSync(); | 633 testCreateTempErrorSync(); |
| 635 testCreateTempError(); | 634 testCreateTempError(); |
| 636 testCreateExistingSync(); | 635 testCreateExistingSync(); |
| 637 testCreateExisting(); | 636 testCreateExisting(); |
| 638 testCreateDirExistingFileSync(); | 637 testCreateDirExistingFileSync(); |
| 639 testCreateDirExistingFile(); | 638 testCreateDirExistingFile(); |
| 640 testCreateRecursive(); | 639 testCreateRecursive(); |
| 641 testCreateRecursiveSync(); | 640 testCreateRecursiveSync(); |
| 642 testRename(); | 641 testRename(); |
| 643 } | 642 } |
| OLD | NEW |