Files
s41r4j 0f03d49514
CI / contracts (push) Canceled after 0s
Website / deploy (push) Canceled after 0s
CI / test (macos-latest) (push) Canceled after 0s
CI / test (ubuntu-24.04) (push) Canceled after 0s
CI / test (ubuntu-24.04-arm) (push) Canceled after 0s
CI / test (windows-latest) (push) Canceled after 0s
CI / Compact real-tool fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Compact real-tool fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Code analysis fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Code analysis fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Web engine fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Web engine fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Chromium operation fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Chromium operation fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / operation-readiness (push) Canceled after 0s
CI / Supply chain fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Supply chain fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
Initial commit
2026-11-01 09:14:18 +05:30

24 lines
504 B
Go

package registry
import (
"github.com/s41r4j/cybot/pkg/schema"
"testing"
)
func TestRegistryStableListAndDuplicates(t *testing.T) {
r := NewTools()
if err := r.Register(schema.Tool{ID: "z"}); err != nil {
t.Fatal(err)
}
if err := r.Register(schema.Tool{ID: "a"}); err != nil {
t.Fatal(err)
}
if err := r.Register(schema.Tool{ID: "a"}); err == nil {
t.Fatal("expected duplicate error")
}
got := r.List()
if got[0].ID != "a" || got[1].ID != "z" {
t.Fatalf("not sorted: %#v", got)
}
}