Skip to content

Commit

Permalink
Fixing Formatting and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Nov 19, 2023
1 parent d9e921c commit ffcdc76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 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 @@ -785,15 +785,15 @@ mod tests {
// 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();
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!(matches!(unstable_entry(&name, &Value::String("".to_string())), Err(_)));
assert!(unstable_entry(&name, &Value::String("".to_string())).is_err());
}
}
2 changes: 1 addition & 1 deletion library/kani_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub fn modifies(attr: TokenStream, item: TokenStream) -> TokenStream {

/// This module implements Kani attributes in a way that only Kani's compiler can understand.
/// This code should only be activated when pre-building Kani's sysroot.
//#[cfg(kani_sysroot)]
#[cfg(kani_sysroot)]
mod sysroot {
use proc_macro_error::{abort, abort_call_site};

Expand Down

0 comments on commit ffcdc76

Please sign in to comment.