| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import "dart:async"; | 5 import "dart:async"; |
| 6 import "dart:convert"; | 6 import "dart:convert"; |
| 7 import "dart:io"; | 7 import "dart:io"; |
| 8 | 8 |
| 9 testAddressParse() async { | 9 testAddressParse() async { |
| 10 print(new InternetAddress("1.0.2.3").rawAddress); | 10 print(new InternetAddress("1.0.2.3").rawAddress); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 await tmp0.delete(recursive: true); | 467 await tmp0.delete(recursive: true); |
| 468 | 468 |
| 469 assert(!await file2.exists()); | 469 assert(!await file2.exists()); |
| 470 assert(!await file1.exists()); | 470 assert(!await file1.exists()); |
| 471 assert(!await file0.exists()); | 471 assert(!await file0.exists()); |
| 472 assert(!await tmp2.exists()); | 472 assert(!await tmp2.exists()); |
| 473 assert(!await tmp1.exists()); | 473 assert(!await tmp1.exists()); |
| 474 assert(!await tmp0.exists()); | 474 assert(!await tmp0.exists()); |
| 475 } | 475 } |
| 476 | 476 |
| 477 bool testFileOpenDirectoryFails() { |
| 478 File dir = new File(Directory.systemTemp.path); |
| 479 try { |
| 480 dir.openSync(); |
| 481 } on FileSystemException catch (e) { |
| 482 return true; |
| 483 } catch (e) { |
| 484 print("Unexpected Exception: $e"); |
| 485 return false; |
| 486 } |
| 487 } |
| 488 |
| 477 main(List<String> args) async { | 489 main(List<String> args) async { |
| 478 if (args.length >= 1) { | 490 if (args.length >= 1) { |
| 479 if (args[0] == "infinite-loop") { | 491 if (args[0] == "infinite-loop") { |
| 480 while (true); | 492 while (true); |
| 481 } | 493 } |
| 482 } | 494 } |
| 483 | 495 |
| 484 print("Hello, Fuchsia!"); | 496 print("Hello, Fuchsia!"); |
| 485 | 497 |
| 486 print("testAddressParse"); | 498 print("testAddressParse"); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 print("testKill done"); | 544 print("testKill done"); |
| 533 | 545 |
| 534 print("testCopy"); | 546 print("testCopy"); |
| 535 await testCopy(); | 547 await testCopy(); |
| 536 print("testCopy done"); | 548 print("testCopy done"); |
| 537 | 549 |
| 538 print("testRecursiveDelete"); | 550 print("testRecursiveDelete"); |
| 539 await testRecursiveDelete(); | 551 await testRecursiveDelete(); |
| 540 print("testRecursiveDelete done"); | 552 print("testRecursiveDelete done"); |
| 541 | 553 |
| 554 print("testFileOpenDirectoryFails"); |
| 555 bool result = testFileOpenDirectoryFails(); |
| 556 if (result) { |
| 557 print("testFileOpenDirectoryFails done"); |
| 558 } else { |
| 559 print("testFileOpenDirectoryFails FAILED"); |
| 560 } |
| 561 |
| 542 print("Goodbyte, Fuchsia!"); | 562 print("Goodbyte, Fuchsia!"); |
| 543 } | 563 } |
| OLD | NEW |