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 9c520af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration/error.rs
@@ -1,6 +1,6 @@
use std::convert::TryFrom;
use std::error::Error as _;
use std::io;
use std::{fmt, io};

use time::error::{
ComponentRange, ConversionRange, DifferentVariant, Error, Format, IndeterminateOffset,
Expand Down Expand Up @@ -108,6 +108,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 +145,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 9c520af

Please sign in to comment.