fn test_batch3_quoting_rules_universal() {
let quoting_rules = vec![
"SC2053", "SC2054", "SC2055", "SC2056", "SC2057", "SC2058", "SC2060", "SC2061", "SC2062",
"SC2063", "SC2065", "SC2066",
];
for rule in quoting_rules {
assert_eq!(
get_rule_compatibility(rule),
Some(ShellCompatibility::Universal),
"{} should be Universal",
rule
);
}
}
#[test]
fn test_batch3_notsh_count() {
let notsh_rules = vec![
"SC2044", "SC2052", ];
for rule in notsh_rules {
assert_eq!(
get_rule_compatibility(rule),
Some(ShellCompatibility::NotSh)
);
assert!(!should_apply_rule(rule, ShellType::Sh));
assert!(should_apply_rule(rule, ShellType::Bash));
assert!(should_apply_rule(rule, ShellType::Zsh));
}
}
#[test]
fn test_batch3_universal_count() {
let universal_rules = vec![
"SC2038", "SC2040", "SC2041", "SC2042",
"SC2043", "SC2045", "SC2046", "SC2047", "SC2048", "SC2049", "SC2050", "SC2051",
"SC2053", "SC2054", "SC2055", "SC2056", "SC2057", "SC2058", "SC2060", "SC2061", "SC2062",
"SC2063", "SC2059", "SC2064", "SC2065", "SC2066", ];
let unique_count = universal_rules.len();
assert_eq!(unique_count, 26, "Batch 3 should have 26 Universal rules");
for rule in universal_rules {
assert_eq!(
get_rule_compatibility(rule),
Some(ShellCompatibility::Universal),
"{} should be Universal",
rule
);
}
}
#[test]
fn test_batch4_variable_safety_universal() {
let variable_rules = vec![
"SC2067", "SC2068", "SC2069", "SC2070", "SC2071", "SC2072", "SC2073", "SC2074",
];
for rule in variable_rules {
assert_eq!(
get_rule_compatibility(rule),
Some(ShellCompatibility::Universal),
"{} should be Universal",
rule
);
assert!(
should_apply_rule(rule, ShellType::Bash),
"{} should apply to bash",
rule
);
assert!(
should_apply_rule(rule, ShellType::Sh),
"{} should apply to sh",
rule
);
}
}
#[test]
fn test_batch4_quoting_safety_universal() {
let quoting_rules = vec![
"SC2075", "SC2076", "SC2077", "SC2078", "SC2081", "SC2082", "SC2083",
];
for rule in quoting_rules {
assert_eq!(
get_rule_compatibility(rule),
Some(ShellCompatibility::Universal),
"{} should be Universal",
rule
);
assert!(
should_apply_rule(rule, ShellType::Bash),
"{} should apply to bash",
rule
);
assert!(
should_apply_rule(rule, ShellType::Sh),
"{} should apply to sh",
rule
);
}
}