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
4 changes: 4 additions & 0 deletions src/discover/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2576,6 +2576,10 @@ mod tests {
rewrite_command_no_prefixes("uv run --unknown pytest tests/", &[]),
Some("rtk uv run --unknown pytest tests/".into())
);
assert_eq!(
rewrite_command_no_prefixes("uv run --extra dev pytest tests/ -q", &[]),
Some("rtk uv run --extra dev pytest tests/ -q".into())
);
assert_eq!(
rewrite_command_no_prefixes("uv run -m pytest -q", &[]),
Some("rtk uv run -m pytest -q".into())
Expand Down
16 changes: 16 additions & 0 deletions src/hooks/hook_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,22 @@ mod tests {
assert_eq!(cmd, "rtk git add . && rtk cargo test");
}

#[test]
fn test_claude_compound_uv_run_with_options() {
// Claude Code frequently combines setup and option-bearing uv runs in one Bash call.
let input = "cd /repo && uv run --extra dev pytest tests/ -q 2>&1 | tail -12";
let result = run_claude_inner(&claude_input(input)).unwrap();
let v: Value = serde_json::from_str(&result).unwrap();
let cmd = v
.pointer("/hookSpecificOutput/updatedInput/command")
.and_then(|c| c.as_str())
.unwrap();
assert_eq!(
cmd,
"cd /repo && rtk uv run --extra dev pytest tests/ -q 2>&1 | tail -12"
);
}

#[test]
fn test_claude_json_output_structure() {
let result = run_claude_inner(&claude_input("git status")).unwrap();
Expand Down