Skip to content

Commit

Permalink
Revert some clippy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Dec 1, 2023
1 parent 907a7f9 commit 1c71508
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions kani-driver/src/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,15 @@ mod tests {
#[test]
fn check_multiple_harnesses() {
let args =
StandaloneArgs::try_parse_from("kani input.rs --harness a --harness b".split(' '))
StandaloneArgs::try_parse_from("kani input.rs --harness a --harness b".split(" "))
.unwrap();
assert_eq!(args.verify_opts.harnesses, vec!["a".to_owned(), "b".to_owned()]);
}

#[test]
fn check_multiple_harnesses_without_flag_fail() {
let result = StandaloneArgs::try_parse_from(
"kani input.rs --harness harness_1 harness_2".split(' '),
"kani input.rs --harness harness_1 harness_2".split(" "),
);
assert!(result.is_err());
assert_eq!(result.unwrap_err().kind(), ErrorKind::UnknownArgument);
Expand Down Expand Up @@ -784,15 +784,16 @@ mod tests {
fn check_dry_run_fails() {
// We don't support --dry-run anymore but we print a friendly reminder for now.
let args = vec!["kani", "file.rs", "--dry-run"];
let err = StandaloneArgs::try_parse_from(args).unwrap().verify_opts.validate().unwrap_err();
let err =
StandaloneArgs::try_parse_from(&args).unwrap().verify_opts.validate().unwrap_err();
assert_eq!(err.kind(), ErrorKind::ValueValidation);
}

/// Kani should fail if the argument given is not a file.
#[test]
fn check_invalid_input_fails() {
let args = vec!["kani", "."];
let err = StandaloneArgs::try_parse_from(args).unwrap().validate().unwrap_err();
let err = StandaloneArgs::try_parse_from(&args).unwrap().validate().unwrap_err();
assert_eq!(err.kind(), ErrorKind::InvalidValue);
}

Expand Down
2 changes: 1 addition & 1 deletion kani-driver/src/args_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,6 @@ mod tests {
#[test]
fn check_unstable_entry_invalid() {
let name = String::from("feature");
assert!(unstable_entry(&name, &Value::String("".to_string())).is_err());
assert!(matches!(unstable_entry(&name, &Value::String("".to_string())), Err(_)));
}
}

0 comments on commit 1c71508

Please sign in to comment.