Skip to content

Commit

Permalink
Add a test for Debug for io::Error
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Atashian <retep998@gmail.com>
  • Loading branch information
retep998 committed Jun 19, 2015
1 parent 9a6b611 commit c8aec53
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/libstd/io/error.rs
Expand Up @@ -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() {
Expand Down

0 comments on commit c8aec53

Please sign in to comment.