From 5d60ee7f1280d8000b918e7fb9e11e3ddca779e7 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 15 Mar 2022 18:15:56 -0400 Subject: chore(test_util): use pretty_assertions::assert_eq when not pattern matching (#13965) --- test_util/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test_util/src/lib.rs') diff --git a/test_util/src/lib.rs b/test_util/src/lib.rs index 664469cf8..75a8840e3 100644 --- a/test_util/src/lib.rs +++ b/test_util/src/lib.rs @@ -15,6 +15,7 @@ use hyper::Response; use hyper::StatusCode; use lazy_static::lazy_static; use os_pipe::pipe; +use pretty_assertions::assert_eq; use regex::Regex; use rustls::Certificate; use rustls::PrivateKey; @@ -1801,7 +1802,9 @@ impl CheckOutputIntegrationTest { std::fs::read_to_string(output_path).expect("cannot read output") }; - if !wildcard_match(&expected, &actual) { + if !expected.contains("[WILDCARD]") { + assert_eq!(actual, expected) + } else if !wildcard_match(&expected, &actual) { println!("OUTPUT\n{}\nOUTPUT", actual); println!("EXPECTED\n{}\nEXPECTED", expected); panic!("pattern match failed"); @@ -2090,6 +2093,7 @@ pub fn parse_max_mem(output: &str) -> Option { #[cfg(test)] mod tests { use super::*; + use pretty_assertions::assert_eq; #[test] fn parse_wrk_output_1() { -- cgit v1.2.3