Skip to content
Open
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions src/discover/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,27 @@ mod tests {
);
}

#[test]
fn test_classify_swift_test() {
assert!(matches!(
classify_command("swift test"),
Classification::Supported {
rtk_equivalent: "rtk swift",
category: "Build",
estimated_savings_pct: 90.0,
status: RtkStatus::Existing,
}
));
}

#[test]
fn test_rewrite_swift_test() {
assert_eq!(
rewrite_command("swift test --parallel", &[]),
Some("rtk swift test --parallel".into())
);
}

// --- #336: docker compose supported subcommands rewritten, unsupported skipped ---

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/discover/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub const PATTERNS: &[&str] = &[
r"^shellcheck\b",
r"^shopify\s+theme\s+(push|pull)",
r"^sops\b",
r"^swift\s+build\b",
r"^swift\s+(build|test)\b",
r"^systemctl\s+status\b",
r"^terraform\s+plan",
r"^tofu\s+(fmt|init|plan|validate)(\s|$)",
Expand Down Expand Up @@ -600,7 +600,7 @@ pub const RULES: &[RtkRule] = &[
rewrite_prefixes: &["swift"],
category: "Build",
savings_pct: 65.0,
subcmd_savings: &[],
subcmd_savings: &[("test", 90.0)],
subcmd_status: &[],
},
RtkRule {
Expand Down