From 217790ab6051fb8efca64cb9a0581908a482c93c Mon Sep 17 00:00:00 2001 From: bluss Date: Sun, 15 Sep 2019 13:05:03 +0200 Subject: [PATCH] TEST: In array format tests, don't print strings twice in assertion --- src/arrayformat.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/arrayformat.rs b/src/arrayformat.rs index 42575307c..27bc0e636 100644 --- a/src/arrayformat.rs +++ b/src/arrayformat.rs @@ -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, ); }