diff options
| author | Sébastien Marie <semarie@users.noreply.github.com> | 2015-02-17 11:11:53 +0100 |
|---|---|---|
| committer | Sébastien Marie <semarie@users.noreply.github.com> | 2015-02-17 11:11:53 +0100 |
| commit | 9eeaa3c78694ec593450e5dd96a5f3fa10afd434 (patch) | |
| tree | 56d5d578eca1584ef693e8960ff9f6125c8bab85 /src/libstd/old_io | |
| parent | 81bce5290ff55b9a2eddd83d31b0778180904d7f (diff) | |
| download | rust-9eeaa3c78694ec593450e5dd96a5f3fa10afd434.tar.gz rust-9eeaa3c78694ec593450e5dd96a5f3fa10afd434.zip | |
openbsd: adapt connect_error test
The connect_error test check if connecting to "0.0.0.0:1" works (it shouldn't). And in case of error, the test expects a ConnectionRefused error. Under OpenBSD, trying to connect to "0.0.0.0" isn't a ConnectionRefused: it is an InvalidInput error. The patch allow the error to be ConnectionRefused or InvalidInput.
Diffstat (limited to 'src/libstd/old_io')
| -rw-r--r-- | src/libstd/old_io/net/tcp.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/old_io/net/tcp.rs b/src/libstd/old_io/net/tcp.rs index ebf7f6cc0f2..45dba733535 100644 --- a/src/libstd/old_io/net/tcp.rs +++ b/src/libstd/old_io/net/tcp.rs @@ -494,6 +494,7 @@ mod test { use old_io::{EndOfFile, TimedOut, ShortWrite, IoError}; use old_io::{ConnectionRefused, BrokenPipe, ConnectionAborted}; use old_io::{ConnectionReset, NotConnected, PermissionDenied, OtherIoError}; + use old_io::{InvalidInput}; use old_io::{Acceptor, Listener}; // FIXME #11530 this fails on android because tests are run as root @@ -510,7 +511,8 @@ mod test { fn connect_error() { match TcpStream::connect("0.0.0.0:1") { Ok(..) => panic!(), - Err(e) => assert_eq!(e.kind, ConnectionRefused), + Err(e) => assert!((e.kind == ConnectionRefused) + || (e.kind == InvalidInput)), } } |
