MCPcopy Create free account
hub / github.com/diillson/chatcli / TestContextStringSlice

Function TestContextStringSlice

cli/plugins/builtin_context_test.go:129–144  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

127}
128
129func TestContextStringSlice(t *testing.T) {
130 _, raw, err := parseContextInvocation([]string{`{"cmd":"create","args":{"name":"x","paths":["a.jsonl","b"]}}`})
131 if err != nil {
132 t.Fatal(err)
133 }
134 got := contextStringSlice(raw, "paths", "path")
135 if strings.Join(got, ",") != "a.jsonl,b" {
136 t.Fatalf("array paths = %v", got)
137 }
138 // CSV single string
139 _, raw2, _ := parseContextInvocation([]string{`{"cmd":"create","args":{"name":"x","paths":"a.jsonl, b"}}`})
140 got2 := contextStringSlice(raw2, "paths")
141 if strings.Join(got2, ",") != "a.jsonl,b" {
142 t.Fatalf("csv paths = %v", got2)
143 }
144}
145
146func TestContextExecuteDispatch(t *testing.T) {
147 f := withFakeContextAdapter(t)

Callers

nothing calls this directly

Calls 2

parseContextInvocationFunction · 0.85
contextStringSliceFunction · 0.85

Tested by

no test coverage detected