Index: tests/standalone/io/socket_test.dart |
diff --git a/tests/standalone/io/socket_test.dart b/tests/standalone/io/socket_test.dart |
index 3ebadf8043ea4fc2d914123ba8795927ac30dfdc..5f7253a8d0f81ad1cc27462a8069be051aa74a70 100644 |
--- a/tests/standalone/io/socket_test.dart |
+++ b/tests/standalone/io/socket_test.dart |
@@ -199,6 +199,35 @@ void testConnectStreamDataCloseCancel(bool useDestroy) { |
}); |
} |
+ |
+void testConnectMultipleInternetAddress() { |
+ // Ip addresses are invalid, if they start with '0'. We use this fact, to |
+ // avoid waiting for timeout. |
+ asyncStart(); |
+ ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) { |
+ server.listen( |
+ (client) { |
+ client.destroy(); |
+ server.close(); |
+ asyncEnd(); |
+ }); |
+ var addresses = [new InternetAddress("0.42.42.42"), |
+ new InternetAddress("127.0.0.1")]; |
+ Socket.connect(addresses, server.port).then((socket) { |
+ socket.destroy(); |
+ }); |
+ }); |
+ |
+ var addresses = [new InternetAddress("0.42.42.42"), |
+ new InternetAddress("0.42.42.43")]; |
+ asyncStart(); |
+ Socket.connect(addresses, 3213) |
+ .catchError((error) { |
+ Expect.equals("0.42.42.43", error.address.host); |
+ asyncEnd(); |
+ }); |
+} |
+ |
main() { |
testArguments(); |
testSimpleBind(); |
@@ -211,4 +240,5 @@ main() { |
testConnectStreamDataClose(false); |
testConnectStreamDataCloseCancel(true); |
testConnectStreamDataCloseCancel(false); |
+ testConnectMultipleInternetAddress(); |
} |