MCPcopy
hub / github.com/cortesi/devd / TestRouteCollection

Function TestRouteCollection

route_test.go:172–193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

170}
171
172func TestRouteCollection(t *testing.T) {
173 var m = make(RouteCollection)
174 _ = m.String()
175 err := m.Add("foo=bar", []string{})
176 if err != nil {
177 t.Error(err)
178 }
179 err = m.Add("foo", []string{})
180 if err != nil {
181 t.Error(err)
182 }
183
184 err = m.Add("xxx=bar", []string{})
185 if err != nil {
186 t.Errorf("Set error: %s", err)
187 }
188
189 err = m.Add("xxx=bar", []string{})
190 if err == nil {
191 t.Errorf("Expected error, got: %s", m)
192 }
193}
194
195func TestNotFound(t *testing.T) {
196 e, _ := newFilesystemEndpoint("/test", []string{})

Callers

nothing calls this directly

Calls 2

AddMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected