grokkit/internal/docs/docs_test.go
Greg Gauthier fe25d7fa37
All checks were successful
CI / Test (pull_request) Successful in 1m20s
CI / Lint (pull_request) Successful in 50s
CI / Build (pull_request) Successful in 40s
feat(mcp): implement recipe and prompt listing with handlers
- Add ListRecipes and ListAvailablePrompts functions
- Update MCP server handlers for local/global recipes and prompts
- Add unit tests for analyze, docs, mcp, prompts, recipe, and testgen packages
2026-04-06 15:44:30 +01:00

31 lines
725 B
Go

package docs
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestBuildDocsMessages(t *testing.T) {
tests := []struct {
language string
code string
styleCheck string
}{
{language: "Go", code: "func Foo() {}", styleCheck: "godoc"},
{language: "Python", code: "def foo(): pass", styleCheck: "PEP 257"},
{language: "JavaScript", code: "function foo() {}", styleCheck: "JSDoc"},
}
for _, tt := range tests {
t.Run(tt.language, func(t *testing.T) {
msgs := BuildDocsMessages(tt.language, tt.code)
assert.Len(t, msgs, 2)
assert.Equal(t, "system", msgs[0]["role"])
assert.Equal(t, "user", msgs[1]["role"])
assert.Contains(t, msgs[0]["content"], tt.styleCheck)
})
}
}