From 0c4ea79e2e905d77471cf52482c8f8959b423a4b Mon Sep 17 00:00:00 2001 From: lazytype Date: Mon, 1 Mar 2021 14:13:02 -0500 Subject: [PATCH] Slightly improve highlight test hygiene --- cli/src/highlight.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/highlight.rs b/cli/src/highlight.rs index e39f47e9..f5cf4dbe 100644 --- a/cli/src/highlight.rs +++ b/cli/src/highlight.rs @@ -289,7 +289,7 @@ fn write_color(buffer: &mut String, color: Color) { Color::Purple => "purple", Color::White => "white", Color::Fixed(n) => CSS_STYLES_BY_COLOR_ID[n as usize].as_str(), - _ => panic!("unreachable"), + Color::RGB(_, _, _) => unreachable!(), } ) .unwrap() @@ -456,6 +456,8 @@ mod tests { if let Ok(environment_variable) = original_environment_variable { env::set_var("COLORTERM", environment_variable); + } else { + env::remove_var("COLORTERM"); } } }