Skip to content

Commit

Permalink
TEST: In array format tests, don't print strings twice in assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
bluss committed Sep 15, 2019
1 parent f489851 commit 217790a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/arrayformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ mod formatting_with_omit {
use crate::prelude::*;

fn assert_str_eq(expected: &str, actual: &str) {
assert_eq!(
expected, actual,
"\nexpected:\n{}\nactual:\n{}\n",
// use assert to avoid printing the strings twice on failure
assert!(
expected == actual,
"formatting assertion failed\nexpected:\n{}\nactual:\n{}\n",
expected, actual,
);
}
Expand Down

0 comments on commit 217790a

Please sign in to comment.