diff --git a/tests/api.rs b/tests/api.rs index 8ae660ed4a..88933d48e9 100644 --- a/tests/api.rs +++ b/tests/api.rs @@ -5,6 +5,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::mem; use std::fmt; use std::env; +use std::error::Error; use std::io::{self, Write, Read}; use rustls; @@ -946,8 +947,9 @@ fn stream_write_reports_underlying_io_error_before_plaintext_processed() { let mut client_stream = Stream::new(&mut client, &mut pipe); let rc = client_stream.write(b"world"); assert!(rc.is_err()); - assert_eq!(format!("{:?}", rc), - "Err(Custom { kind: WouldBlock, error: StringError(\"oops\") })"); + let err = rc.err().unwrap(); + assert_eq!(err.kind(), io::ErrorKind::WouldBlock); + assert_eq!(err.description(), "oops"); } #[test]