MCPcopy
hub / github.com/sipeed/picoclaw / TestToolRegistry_RegisterOverwrite

Function TestToolRegistry_RegisterOverwrite

pkg/tools/registry_test.go:182–194  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

180}
181
182func TestToolRegistry_RegisterOverwrite(t *testing.T) {
183 r := NewToolRegistry()
184 r.Register(newMockTool("dup", "first"))
185 r.Register(newMockTool("dup", "second"))
186
187 if r.Count() != 1 {
188 t.Errorf("expected count 1 after overwrite, got %d", r.Count())
189 }
190 tool, _ := r.Get("dup")
191 if tool.Description() != "second" {
192 t.Errorf("expected overwritten description 'second', got %q", tool.Description())
193 }
194}
195
196func TestToolRegistry_Execute_Success(t *testing.T) {
197 r := NewToolRegistry()

Callers

nothing calls this directly

Calls 7

RegisterMethod · 0.95
CountMethod · 0.95
GetMethod · 0.95
NewToolRegistryFunction · 0.85
newMockToolFunction · 0.85
ErrorfMethod · 0.80
DescriptionMethod · 0.65

Tested by

no test coverage detected