Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
29 lines
868 B
Go
29 lines
868 B
Go
package events
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
)
|
|
|
|
func TestTurnCapabilityReferencesSurviveJSONRoundTrip(t *testing.T) {
|
|
event := Event{Payload: EventPayload{}}
|
|
StampTurnCapabilityReferences(&event, []CapabilityReference{
|
|
{Capability: " tutti ", Source: "slash_command"},
|
|
{Capability: "tutti", Source: "slash_command"},
|
|
{Capability: "", Source: "slash_command"},
|
|
})
|
|
|
|
encoded, err := json.Marshal(event.Payload.Metadata)
|
|
if err != nil {
|
|
t.Fatalf("marshal metadata: %v", err)
|
|
}
|
|
var metadata map[string]any
|
|
if err := json.Unmarshal(encoded, &metadata); err != nil {
|
|
t.Fatalf("unmarshal metadata: %v", err)
|
|
}
|
|
got := TurnCapabilityReferencesFromEvent(Event{Payload: EventPayload{Metadata: metadata}})
|
|
if len(got) != 1 || got[0] != (CapabilityReference{Capability: "tutti", Source: "slash_command"}) {
|
|
t.Fatalf("capability refs = %#v", got)
|
|
}
|
|
}
|