diff options
| author | Peter Atashian <retep998@gmail.com> | 2015-06-19 12:55:59 -0400 |
|---|---|---|
| committer | Peter Atashian <retep998@gmail.com> | 2015-06-19 12:55:59 -0400 |
| commit | c8aec53db73182f453621c284131ef028d0ae064 (patch) | |
| tree | 6b9d4576a4815d45bc1adc246c1c3cb14a3cf4ad /src/libstd | |
| parent | 9a6b611a07f58bfd0ac1a26d1b25274202356d4a (diff) | |
| download | rust-c8aec53db73182f453621c284131ef028d0ae064.tar.gz rust-c8aec53db73182f453621c284131ef028d0ae064.zip | |
Add a test for Debug for io::Error
Signed-off-by: Peter Atashian <retep998@gmail.com>
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/error.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 1976c77a1e4..a66789bf287 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -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() { |
