Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Debug impl for io::Error #26416

Merged
merged 2 commits into from
Jun 21, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add a test for Debug for io::Error
Signed-off-by: Peter Atashian <[email protected]>
  • Loading branch information
retep998 committed Jun 19, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit c8aec53db73182f453621c284131ef028d0ae064
10 changes: 10 additions & 0 deletions src/libstd/io/error.rs
Original file line number Diff line number Diff line change
@@ -292,6 +292,16 @@ mod test {
use error;
use error::Error as error_Error;
use fmt;
use sys::os::error_string;

#[test]
fn test_debug_error() {
let code = 6;
let msg = error_string(code);
let err = Error { repr: super::Repr::Os(code) };
let expected = format!("Error {{ repr: Os {{ code: {:?}, message: {:?} }} }}", code, msg);
assert_eq!(format!("{:?}", err), expected);
}

#[test]
fn test_downcasting() {