Skip to content

Commit

Permalink
test: modify tests as clap changes
Browse files Browse the repository at this point in the history
  • Loading branch information
moz-sec committed Jul 22, 2024
1 parent 19fe03d commit e4f9926
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct CliArgs {
pub count: u32,
}

#[derive(Debug, Clone, ValueEnum)]
#[derive(Debug, Clone, ValueEnum, PartialEq)]
pub enum Format {
Zip,
Tar,
Expand Down
11 changes: 4 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ mod tests {

#[test]
fn test_run() {
let opts =
cli::CliArgs::parse_from(&["unicom", "-f", "zip", "-r", "-c", "8", "file1", "file2"]);
assert_eq!(
opts.files,
vec![PathBuf::from("file1"), PathBuf::from("file2")]
);
assert_eq!(opts.count, 8);
let opts = cli::CliArgs::parse_from(&["unicom", "-f", "zip", "-r", "file1", "file2"]);
assert_eq!(opts.archive_file, PathBuf::from("file1"));
assert_eq!(opts.files, vec![PathBuf::from("file2")]);
assert_eq!(opts.format, cli::Format::Zip);
}
}

0 comments on commit e4f9926

Please sign in to comment.