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

Function TestComputeScope

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

Source from the content-addressed store, hash-verified

69}
70
71func TestComputeScope(t *testing.T) {
72 tests := []struct {
73 name string
74 files []string
75 want string
76 }{
77 {"no files", nil, "unknown"},
78 {"single file", []string{"cmd/hooks.go"}, "single-file"},
79 {"same package", []string{"cmd/hooks.go", "cmd/intent.go"}, "package"},
80 {"cross-cutting", []string{"cmd/hooks.go", "watch/daemon.go", "mcp/main.go"}, "cross-cutting"},
81 {"root files same package", []string{"main.go", "helpers.go"}, "package"},
82 }
83
84 for _, tt := range tests {
85 t.Run(tt.name, func(t *testing.T) {
86 got := computeScope(tt.files)
87 if got != tt.want {
88 t.Errorf("computeScope(%v) = %q, want %q", tt.files, got, tt.want)
89 }
90 })
91 }
92}
93
94func TestAnalyzeRisk_NoHubs(t *testing.T) {
95 info := &hubInfo{

Callers

nothing calls this directly

Calls 1

computeScopeFunction · 0.85

Tested by

no test coverage detected