提交 3686c6cb 编写于 作者: K klutzy

std::rt::io::net::tcp: Fix one tcp test on Win32

Fixes `connect_error` part of #8811.
上级 879cfe60
......@@ -178,12 +178,17 @@ fn bind_error() {
}
#[test]
#[ignore(cfg(windows))] // FIXME #8811
fn connect_error() {
do run_in_mt_newsched_task {
let mut called = false;
do io_error::cond.trap(|e| {
assert_eq!(e.kind, ConnectionRefused);
let expected_error = if cfg!(unix) {
ConnectionRefused
} else {
// On Win32, opening port 1 gives WSAEADDRNOTAVAIL error.
OtherIoError
};
assert_eq!(e.kind, expected_error);
called = true;
}).inside {
let addr = SocketAddr { ip: Ipv4Addr(0, 0, 0, 0), port: 1 };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册