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

Function TestParseSpec

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

Source from the content-addressed store, hash-verified

82}
83
84func TestParseSpec(t *testing.T) {
85 for i, tt := range newSpecTests {
86 s, err := newRoute(tt.raw, []string{})
87 if tt.spec != nil {
88 if err != nil {
89 t.Errorf("Test %d, error:\n%s\n", i, err)
90 continue
91 }
92 if !reflect.DeepEqual(s, tt.spec) {
93 t.Errorf("Test %d, expecting:\n%s\nGot:\n%s\n", i, tt.spec, s)
94 continue
95 }
96 } else if tt.err != "" {
97 if err == nil {
98 t.Errorf("Test %d, expected error:\n%s\n", i, tt.err)
99 continue
100 }
101 if !within(tt.err, err) {
102 t.Errorf(
103 "Test %d, expected error:\n%s\nGot error:%s\n",
104 i,
105 tt.err,
106 err,
107 )
108 continue
109 }
110 }
111 }
112}
113
114func TestForwardEndpoint(t *testing.T) {
115 f, err := newForwardEndpoint("http://foo")

Callers

nothing calls this directly

Calls 2

newRouteFunction · 0.85
withinFunction · 0.85

Tested by

no test coverage detected