test: isolate generic agent executable fixture

This commit is contained in:
GeekMr committed 2026-09-21 22:01:52 +08:00
1 parent d192e2a190
commit a2baa66c49
1 file changed
+6 -5
@@ -194,11 +194,12 @@ mod tests {
let dirs = vec![grok_dir, cursor_dir];
assert_eq!(find_executable(AgentKind::Cursor, &dirs), Some(cursor));
assert_eq!(find_executable(AgentKind::Grok, &dirs), Some(grok));
executable(dir.path(), "agent");
executable(dir.path(), "cursor");
assert_eq!(find_executable(AgentKind::Cursor, &[dir.path().to_path_buf()]), None);
let cli = executable(dir.path(), "cursor-agent");
assert_eq!(find_executable(AgentKind::Cursor, &[dir.path().to_path_buf()]), Some(cli));
let generic_dir = dir.path().join("bin");
executable(&generic_dir, "agent");
executable(&generic_dir, "cursor");
assert_eq!(find_executable(AgentKind::Cursor, &[generic_dir.clone()]), None);
let cli = executable(&generic_dir, "cursor-agent");
assert_eq!(find_executable(AgentKind::Cursor, &[generic_dir]), Some(cli));
}
#[test]