use grip::args::Args;
#[test]
fn default_path_is_dot() {
let args = Args::parse_from_args(vec!["cargo-grip4rust"]);
assert_eq!(args.path.to_string_lossy(), ".");
}
#[test]
fn json_flag_is_false_by_default() {
let args = Args::parse_from_args(vec!["cargo-grip4rust"]);
assert_eq!(args.json, false);
}
#[test]
fn threshold_is_none_by_default() {
let args = Args::parse_from_args(vec!["cargo-grip4rust"]);
assert_eq!(args.threshold, None);
}
#[test]
fn path_arg_is_parsed() {
let args = Args::parse_from_args(vec!["cargo-grip4rust", "some/path"]);
assert_eq!(args.path.to_string_lossy(), "some/path");
}
#[test]
fn json_flag_is_parsed() {
let args = Args::parse_from_args(vec!["cargo-grip4rust", "--json"]);
assert_eq!(args.json, true);
}
#[test]
fn threshold_is_parsed() {
let args = Args::parse_from_args(vec!["cargo-grip4rust", "--threshold", "50"]);
assert_eq!(args.threshold, Some(50));
}
#[test]
fn min_score_alias_still_works() {
let args = Args::parse_from_args(vec!["cargo-grip4rust", "--min-score", "30"]);
assert_eq!(args.threshold, Some(30));
}