Files
kandev/apps/backend/internal/mcp/toolschema/schema_test.go
T
2026-08-12 20:25:13 +01:00

19 lines
498 B
Go

package toolschema
import "testing"
func TestCompileRequiresObjectRoot(t *testing.T) {
if _, err := Compile("test", map[string]any{"type": "string"}); err == nil {
t.Fatal("Compile() expected non-object root error")
}
}
func TestCompileAcceptsObjectSchema(t *testing.T) {
if _, err := Compile("test", map[string]any{
"type": "object",
"properties": map[string]any{"name": map[string]any{"type": "string"}},
}); err != nil {
t.Fatalf("Compile() unexpected error: %v", err)
}
}