Skip to content

Commit

Permalink
Add tests for new error source and display
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathspy committed Jan 3, 2022
1 parent 09d9117 commit 0825cae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration/error.rs
@@ -1,5 +1,6 @@
use std::convert::TryFrom;
use std::error::Error as _;
use std::fmt;
use std::io;

use time::error::{
Expand Down Expand Up @@ -108,6 +109,7 @@ fn display() {
Error::from(invalid_format_description())
);
assert_display_eq!(io_error(), Format::from(io_error()));
assert_display_eq!(fmt::Error, Format::from(fmt::Error));
assert_display_eq!(DifferentVariant, Error::from(DifferentVariant));
}

Expand Down Expand Up @@ -144,6 +146,7 @@ fn source() {
InvalidFormatDescription
);
assert_source!(Format::from(io_error()), io::Error);
assert_source!(Format::from(fmt::Error), fmt::Error);
assert_source!(Error::from(DifferentVariant), DifferentVariant);
}

Expand Down

0 comments on commit 0825cae

Please sign in to comment.