MCPcopy Create free account
hub / github.com/JordanCoin/codemap / TestClassifyIntent_SubsystemMatching

Function TestClassifyIntent_SubsystemMatching

cmd/intent_test.go:209–233  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

207}
208
209func TestClassifyIntent_SubsystemMatching(t *testing.T) {
210 cfg := config.ProjectConfig{
211 Routing: config.RoutingConfig{
212 Retrieval: config.RetrievalConfig{Strategy: "keyword", TopK: 3},
213 Subsystems: []config.Subsystem{
214 {ID: "watching", Keywords: []string{"hook", "daemon", "events"}},
215 {ID: "scanning", Keywords: []string{"ast-grep", "dependency", "imports"}},
216 },
217 },
218 }
219
220 intent := classifyIntent("fix the hook timeout in the daemon", nil, nil, cfg)
221 if len(intent.Subsystems) == 0 {
222 t.Error("expected subsystem match for 'hook' and 'daemon' keywords")
223 }
224 found := false
225 for _, s := range intent.Subsystems {
226 if s == "watching" {
227 found = true
228 }
229 }
230 if !found {
231 t.Errorf("expected 'watching' subsystem in %v", intent.Subsystems)
232 }
233}
234
235func TestClassifyIntent_NilInfoSafe(t *testing.T) {
236 // Should not panic with nil hubInfo

Callers

nothing calls this directly

Calls 2

classifyIntentFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected