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

Function TestClassifyIntent_Categories

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

Source from the content-addressed store, hash-verified

7)
8
9func TestClassifyIntent_Categories(t *testing.T) {
10 tests := []struct {
11 name string
12 prompt string
13 wantCat string
14 }{
15 {"refactor keyword", "refactor the scanner package", "refactor"},
16 {"rename keyword", "rename this function to something better", "refactor"},
17 {"cleanup keyword", "clean up the old auth code", "refactor"},
18 {"fix keyword", "fix the broken test in hooks", "bugfix"},
19 {"bug keyword", "there's a bug in the daemon", "bugfix"},
20 {"error keyword", "getting an error when I run this", "bugfix"},
21 {"add keyword", "add a new MCP tool for skills", "feature"},
22 {"implement keyword", "implement working-set tracking", "feature"},
23 {"create keyword", "create a new subcommand", "feature"},
24 {"how does keyword", "how does the handoff system work", "explore"},
25 {"where is keyword", "where is the hub detection logic", "explore"},
26 {"test keyword", "add test coverage for the intent system", "test"},
27 {"coverage keyword", "what's the coverage on this package", "test"},
28 {"document keyword", "document the new API", "docs"},
29 {"readme keyword", "update the readme with new features", "docs"},
30 {"empty prompt defaults", "", "feature"},
31 {"no signals defaults", "hello world", "feature"},
32 }
33
34 for _, tt := range tests {
35 t.Run(tt.name, func(t *testing.T) {
36 intent := classifyIntent(tt.prompt, nil, nil, config.ProjectConfig{})
37 if intent.Category != tt.wantCat {
38 t.Errorf("classifyIntent(%q).Category = %q, want %q", tt.prompt, intent.Category, tt.wantCat)
39 }
40 })
41 }
42}
43
44func TestClassifyIntent_Confidence(t *testing.T) {
45 // Pure refactor prompt should have high confidence

Callers

nothing calls this directly

Calls 1

classifyIntentFunction · 0.85

Tested by

no test coverage detected