From dc1f7bf807cf1de51dc64fccaa8afae285e43ede Mon Sep 17 00:00:00 2001 From: Alex <mashkal2000@gmail.com> Date: Sat, 20 Jan 2024 22:22:50 -0800 Subject: [PATCH] Add missing value check to test. This requires the enum to derive Debug and PartialEq. --- src/parse_args.rs | 2 +- src/test.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parse_args.rs b/src/parse_args.rs index dadc4f7..249a531 100644 --- a/src/parse_args.rs +++ b/src/parse_args.rs @@ -1,6 +1,6 @@ use std::{env::Args, collections::HashMap}; -#[derive(Default)] +#[derive(Default, PartialEq, Debug)] pub enum UTF8Strategy { #[default] Panic, diff --git a/src/test.rs b/src/test.rs index 86b517a..1acc577 100644 --- a/src/test.rs +++ b/src/test.rs @@ -401,7 +401,9 @@ mod tests { #[test] fn test_parse_utf8_valid() { - parse_args(&vec!["asd", "--invalid-utf8", "skip-line"]); + let config = parse_args(&vec!["asd", "--invalid-utf8", "skip-line"]); + assert_eq!(config.search_string, "asd"); + assert_eq!(config.decode_strategy, UTF8Strategy::SkipLine); } #[test]