Skip to content

Commit 217790a

Browse files
committed
TEST: In array format tests, don't print strings twice in assertion
1 parent f489851 commit 217790a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/arrayformat.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,10 @@ mod formatting_with_omit {
233233
use crate::prelude::*;
234234

235235
fn assert_str_eq(expected: &str, actual: &str) {
236-
assert_eq!(
237-
expected, actual,
238-
"\nexpected:\n{}\nactual:\n{}\n",
236+
// use assert to avoid printing the strings twice on failure
237+
assert!(
238+
expected == actual,
239+
"formatting assertion failed\nexpected:\n{}\nactual:\n{}\n",
239240
expected, actual,
240241
);
241242
}

0 commit comments

Comments
 (0)