| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 try { | 479 try { |
| 480 dir.openSync(); | 480 dir.openSync(); |
| 481 } on FileSystemException catch (e) { | 481 } on FileSystemException catch (e) { |
| 482 return true; | 482 return true; |
| 483 } catch (e) { | 483 } catch (e) { |
| 484 print("Unexpected Exception: $e"); | 484 print("Unexpected Exception: $e"); |
| 485 return false; | 485 return false; |
| 486 } | 486 } |
| 487 } | 487 } |
| 488 | 488 |
| 489 |
| 490 Future testListInterfaces() async { |
| 491 List<NetworkInterface> interfaces = await NetworkInterface.list(); |
| 492 print('Found ${interfaces.length} interfaces:'); |
| 493 for (var iface in interfaces) { |
| 494 print('\t$iface'); |
| 495 } |
| 496 } |
| 497 |
| 489 main(List<String> args) async { | 498 main(List<String> args) async { |
| 490 if (args.length >= 1) { | 499 if (args.length >= 1) { |
| 491 if (args[0] == "infinite-loop") { | 500 if (args[0] == "infinite-loop") { |
| 492 while (true); | 501 while (true); |
| 493 } | 502 } |
| 494 } | 503 } |
| 495 | 504 |
| 496 print("Hello, Fuchsia!"); | 505 print("Hello, Fuchsia!"); |
| 497 | 506 |
| 498 print("testAddressParse"); | 507 print("testAddressParse"); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 print("testRecursiveDelete done"); | 561 print("testRecursiveDelete done"); |
| 553 | 562 |
| 554 print("testFileOpenDirectoryFails"); | 563 print("testFileOpenDirectoryFails"); |
| 555 bool result = testFileOpenDirectoryFails(); | 564 bool result = testFileOpenDirectoryFails(); |
| 556 if (result) { | 565 if (result) { |
| 557 print("testFileOpenDirectoryFails done"); | 566 print("testFileOpenDirectoryFails done"); |
| 558 } else { | 567 } else { |
| 559 print("testFileOpenDirectoryFails FAILED"); | 568 print("testFileOpenDirectoryFails FAILED"); |
| 560 } | 569 } |
| 561 | 570 |
| 571 print('testListInterfaces'); |
| 572 await testListInterfaces(); |
| 573 print('testListInterfaces done'); |
| 574 |
| 562 print("Goodbyte, Fuchsia!"); | 575 print("Goodbyte, Fuchsia!"); |
| 563 } | 576 } |
| OLD | NEW |