diff --git a/tests/cli.rs b/tests/cli.rs index 28772de..938b7ce 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -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.