Files
gastown/internal/cmd/dnd_test.go
joe 4bcf50bf1c Revert to simple gt-mayor/gt-deacon session names
Reverts the session naming changes from PR #70. Multi-town support
on a single machine is not a real use case - rigs provide project
isolation, and true isolation should use containers/VMs.

Changes:
- MayorSessionName() and DeaconSessionName() no longer take townName parameter
- ParseSessionName() handles simple gt-mayor and gt-deacon formats
- Removed Town field from AgentIdentity and AgentSession structs
- Updated all callers and tests

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 14:33:24 -08:00

35 lines
858 B
Go

package cmd
import (
"testing"
)
func TestAddressToAgentBeadID(t *testing.T) {
tests := []struct {
address string
expected string
}{
// Mayor and deacon use simple session names (no town qualifier)
{"mayor", "gt-mayor"},
{"deacon", "gt-deacon"},
{"gastown/witness", "gt-gastown-witness"},
{"gastown/refinery", "gt-gastown-refinery"},
{"gastown/alpha", "gt-gastown-polecat-alpha"},
{"gastown/crew/max", "gt-gastown-crew-max"},
{"beads/witness", "gt-beads-witness"},
{"beads/beta", "gt-beads-polecat-beta"},
// Invalid addresses should return empty string
{"invalid", ""},
{"", ""},
}
for _, tt := range tests {
t.Run(tt.address, func(t *testing.T) {
got := addressToAgentBeadID(tt.address)
if got != tt.expected {
t.Errorf("addressToAgentBeadID(%q) = %q, want %q", tt.address, got, tt.expected)
}
})
}
}