mirror of
https://github.com/theniceboy/.config.git
synced 2026-05-11 17:36:05 +08:00
agent tracker + tmux update
This commit is contained in:
parent
cd9c92b1c2
commit
5064629d61
68 changed files with 15041 additions and 3483 deletions
35
agent-tracker/cmd/agent/palette_path_fallback_test.go
Normal file
35
agent-tracker/cmd/agent/palette_path_fallback_test.go
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestDetectPaletteAgentIDFromPath(t *testing.T) {
|
||||
got := detectPaletteAgentIDFromPath("/Users/david/Github/instaboard/.agents/icon-pad/repo")
|
||||
if got != "icon-pad" {
|
||||
t.Fatalf("expected icon-pad, got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPaletteBuildActionsIncludesDestroyWhenAgentIDKnownWithoutRecord(t *testing.T) {
|
||||
r := &paletteRuntime{
|
||||
agentID: "icon-pad",
|
||||
mainRepoRoot: "/tmp/repo",
|
||||
currentPath: "/tmp/repo/.agents/icon-pad/repo",
|
||||
}
|
||||
actions := r.buildActions()
|
||||
for _, action := range actions {
|
||||
if action.Kind == paletteActionConfirmDestroy {
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatalf("destroy action missing: %#v", actions)
|
||||
}
|
||||
|
||||
func TestPaletteEffectiveAgentIDIgnoresLiteralAndUsesPath(t *testing.T) {
|
||||
r := &paletteRuntime{
|
||||
agentID: "#{q:@agent_id}",
|
||||
currentPath: "/tmp/repo/.agents/icon-pad/repo",
|
||||
}
|
||||
if got := r.effectiveAgentID(); got != "icon-pad" {
|
||||
t.Fatalf("expected icon-pad, got %q", got)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue