(t *testing.T)
| 127 | } |
| 128 | |
| 129 | func 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 | |
| 146 | func TestContextExecuteDispatch(t *testing.T) { |
| 147 | f := withFakeContextAdapter(t) |
nothing calls this directly
no test coverage detected