Index: tests/standalone/io/socket_invalid_arguments_test.dart |
diff --git a/tests/standalone/io/socket_invalid_arguments_test.dart b/tests/standalone/io/socket_invalid_arguments_test.dart |
index 803e106714d09e12a4ac001508ae239d5752f7d0..4bc34b602208d4f828c66ace01d2d5ac7f0032d8 100644 |
--- a/tests/standalone/io/socket_invalid_arguments_test.dart |
+++ b/tests/standalone/io/socket_invalid_arguments_test.dart |
@@ -20,12 +20,17 @@ class NotAList { |
testSocketCreation(host, port) { |
asyncStart(); |
- Socket.connect(host, port) |
- .then((socket) => Expect.fail("Shouldn't get connected")) |
- .catchError((e) { |
- Expect.isTrue(e is ArgumentError || e is SocketException); |
- asyncEnd(); |
- }); |
+ try { |
+ Socket.connect(host, port) |
+ .then((socket) => Expect.fail("Shouldn't get connected")) |
+ .catchError((e) { |
+ Expect.isTrue(e is ArgumentError || e is SocketException); |
+ asyncEnd(); |
+ }); |
+ } catch (e) { |
+ Expect.isTrue(e is ArgumentError || e is SocketException); |
+ asyncEnd(); |
+ } |
} |
testAdd(buffer) { |
@@ -71,6 +76,8 @@ main() { |
testSocketCreation(123, 123); |
testSocketCreation("string", null); |
testSocketCreation(null, null); |
+ testSocketCreation("localhost", -1); |
+ testSocketCreation("localhost", 65536); |
testAdd(null); |
testAdd(new NotAList()); |
testAdd(42); |
@@ -82,4 +89,6 @@ main() { |
testServerSocketCreation(123, 123, 123); |
testServerSocketCreation("string", null, null); |
testServerSocketCreation("string", 123, null); |
+ testServerSocketCreation("localhost", -1, 123); |
+ testServerSocketCreation("localhost", 65536, 123); |
} |