Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,22 @@ fn maximumpriority_five_is_accepted() {
assert!(!out.contains("ExcessiveParameterList"), "stdout={out:?}");
}

#[test]
fn default_maximumpriority_includes_priority_one_rules() {
// This test stops the mutation from 1 to 2 for the default Options max_priority.
// CleanCode has BooleanArgumentFlag with priority 1.
// Without --maximumpriority, the tool loads and reports priority 1 rules.
let dir = TempDir::new().unwrap();
let path = write_file(
dir.path(),
"fixture.rs",
"fn process(flag: bool) { let _ = flag; }\n",
);
let (code, out, err) = run_cli(&[path.to_str().unwrap(), "text", "cleancode"]);
assert_eq!(code, EXIT_VIOLATION, "stderr={err:?}");
assert!(out.contains("BooleanArgumentFlag"), "stdout={out:?}");
}

#[test]
fn value_option_before_positionals_consumes_exactly_one_argument() {
// Kills parse_args `i += 1` body/±1 mutants on the value skip.
Expand Down
Loading