From 8cee98288bbc4ad044bfa3df7dc4e1b9be1ed84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 7 Jan 2023 16:02:40 +0100 Subject: [PATCH] TestComponent: Remove hl_bg method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/component/test.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/component/test.rs b/src/component/test.rs index ff9afb3..623a6e9 100644 --- a/src/component/test.rs +++ b/src/component/test.rs @@ -204,10 +204,6 @@ impl Component { buf } - fn hl_bg(color: String) -> String { - format!("{}{}", color, "\x1b[48;5;8m") - } - fn compare_hl(expected: &str, actual: &str) -> String { let hl_expected = Component::hl(expected.clone()); let hl_actual = Component::hl(actual.clone()); @@ -267,7 +263,8 @@ impl Component { } if ! color_added && ! color_start && let Some(ref color) = last_color { - buf_expected.push_str(format!("{}", Component::hl_bg(color.clone())).as_str()); + // Change background + buf_expected.push_str(format!("{}{}", color, "\x1b[48;5;8m").as_str()); color_added = true; }