Skip to content

Commit

Permalink
Add test of assert_eq on strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 9, 2022
1 parent 22c55a8 commit 7b5afed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pretty_assertions/tests/macros.rs
Expand Up @@ -161,6 +161,18 @@ mod assert_eq {
fn fails_custom_trailing_comma() {
::pretty_assertions::assert_eq!(666, 999, "custom panic message",);
}

#[test]
#[should_panic(expected = r#"assertion failed: `(left == right)`
Diff < left / right > :
<"foo\nbar"
>"foo\nbaz"
"#)]
fn fails_str() {
::pretty_assertions::assert_eq!("foo\nbar", "foo\nbaz");
}
}

mod assert_ne {
Expand Down

0 comments on commit 7b5afed

Please sign in to comment.