Skip to content

Commit

Permalink
Add missing value check to test.
Browse files Browse the repository at this point in the history
This requires the enum to derive Debug and PartialEq.
  • Loading branch information
TheBicPen committed Jan 21, 2024
1 parent 789b2af commit dc1f7bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/parse_args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{env::Args, collections::HashMap};

#[derive(Default)]
#[derive(Default, PartialEq, Debug)]
pub enum UTF8Strategy {
#[default]
Panic,
Expand Down
4 changes: 3 additions & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit dc1f7bf

Please sign in to comment.