Skip to content

Commit

Permalink
fix: socket::test::test_receive_unexpected_reply_type_on_connect test
Browse files Browse the repository at this point in the history
Commit fd77155 introduced code that
made a test that was previously passing to fail. This usually means
regression.

I could very very easily add code to make the test pass, but the current
behaviour looks more right to me than the test described behaviour.
Therefore, I'm changing the test.

I won't revert the commit that introduced the "regression" because it
fixes an important bug that wasn't tested. Peter found a lot of issues
when he started emulating dropped packets and writing
more-than-just-unit-tests (something in the direction of integration
tests). Something that was seemingly being neglected previously.
  • Loading branch information
vinipsmaker committed Jan 25, 2016
1 parent 939670f commit 99648c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2510,8 +2510,8 @@ mod test {
});

match UtpSocket::connect(server_addr) {
Err(ref e) if e.kind() == ErrorKind::ConnectionRefused => (), // OK
Err(e) => panic!("Expected ErrorKind::ConnectionRefused, got {:?}", e),
Err(ref e) if e.kind() == ErrorKind::TimedOut => (), // OK
Err(e) => panic!("Expected ErrorKind::TimedOut, got {:?}", e),
Ok(_) => panic!("Expected Err, got Ok"),
}

Expand Down

0 comments on commit 99648c0

Please sign in to comment.