MCPcopy Create free account
hub / github.com/atripati/ark / TestValidateCodeResponse

Function TestValidateCodeResponse

pkg/runtime/quality_test.go:112–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestValidateCodeResponse(t *testing.T) {
113 input := "```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"hello\")\n}\n```"
114 q := ValidateCodeResponse(input)
115 if !q.HasCode {
116 t.Error("should detect code")
117 }
118 if !q.HasImports {
119 t.Error("should detect imports")
120 }
121 if !q.IsComplete {
122 t.Error("should detect complete code")
123 }
124 if q.LinesOfCode < 3 {
125 t.Errorf("expected at least 3 lines of code, got %d", q.LinesOfCode)
126 }
127}
128
129func TestValidateCodeResponseNoCode(t *testing.T) {
130 q := ValidateCodeResponse("This is just text, no code here.")

Callers

nothing calls this directly

Calls 2

ValidateCodeResponseFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected