diff --git a/src/cli.rs b/src/cli.rs index f4510d3..fe97be0 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -37,7 +37,7 @@ pub struct CliArgs { pub count: u32, } -#[derive(Debug, Clone, ValueEnum)] +#[derive(Debug, Clone, ValueEnum, PartialEq)] pub enum Format { Zip, Tar, diff --git a/src/main.rs b/src/main.rs index a23d7d5..b8409d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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); } }