mirror of
https://github.com/mainmatter/100-exercises-to-learn-rust
synced 2025-01-13 08:01:18 +01:00
Check the implementation of Display in the tests.
This commit is contained in:
parent
d9a0c025e9
commit
ae7769d879
1 changed files with 6 additions and 0 deletions
|
@ -95,5 +95,11 @@ mod tests {
|
|||
assert_eq!(ticket.description, "Description not provided");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn display_is_correctly_implemented() {
|
||||
let ticket = Ticket::new("".into(), valid_description(), Status::ToDo);
|
||||
assert_eq!(format!("{}", ticket.unwrap_err()), "Title cannot be empty");
|
||||
}
|
||||
|
||||
assert_impl_one!(TicketNewError: std::error::Error);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue