use super::*;
#[test]
pub(crate) fn diff_flags_accept_changed_region_forms() {
assert!(Cli::try_parse_from(["gruff-rs", "analyse", "--diff-git-unsafe", "--diff"]).is_ok());
assert!(
Cli::try_parse_from(["gruff-rs", "analyse", "--diff-git-unsafe", "--diff", "-"]).is_ok()
);
assert!(Cli::try_parse_from([
"gruff-rs",
"analyse",
"--diff-git-unsafe",
"--since",
"HEAD"
])
.is_ok());
assert!(Cli::try_parse_from(["gruff-rs", "analyse", "--diff"]).is_err());
assert!(Cli::try_parse_from(["gruff-rs", "analyse", "--since", "HEAD"]).is_err());
assert!(Cli::try_parse_from(["gruff-rs", "analyse", "--changed-ranges", "3-3,8-10"]).is_ok());
assert!(Cli::try_parse_from(["gruff-rs", "analyse", "--changed-scope", "hunk"]).is_ok());
let mut command = Cli::command();
let help = command
.find_subcommand_mut("analyse")
.expect("analyse subcommand exists")
.render_long_help()
.to_string();
assert!(help.contains("--since"));
assert!(help.contains("--changed-ranges"));
assert!(help.contains("--changed-scope"));
assert!(!help.contains("--diff-git-unsafe"));
}