Skip to content

Commit 3686c6c

Browse files
committed
std::rt::io::net::tcp: Fix one tcp test on Win32
Fixes `connect_error` part of #8811.
1 parent 879cfe6 commit 3686c6c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/libstd/rt/io/net/tcp.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,17 @@ mod test {
178178
}
179179

180180
#[test]
181-
#[ignore(cfg(windows))] // FIXME #8811
182181
fn connect_error() {
183182
do run_in_mt_newsched_task {
184183
let mut called = false;
185184
do io_error::cond.trap(|e| {
186-
assert_eq!(e.kind, ConnectionRefused);
185+
let expected_error = if cfg!(unix) {
186+
ConnectionRefused
187+
} else {
188+
// On Win32, opening port 1 gives WSAEADDRNOTAVAIL error.
189+
OtherIoError
190+
};
191+
assert_eq!(e.kind, expected_error);
187192
called = true;
188193
}).inside {
189194
let addr = SocketAddr { ip: Ipv4Addr(0, 0, 0, 0), port: 1 };

0 commit comments

Comments
 (0)