(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func 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 | |
| 129 | func TestValidateCodeResponseNoCode(t *testing.T) { |
| 130 | q := ValidateCodeResponse("This is just text, no code here.") |
nothing calls this directly
no test coverage detected