Files
llm-testbench/internal/eval/equals_test.go
T
lukaszraczylo 1d51d4cbbd feat: LLM accuracy testing framework with 17-test catalog
Framework runs a category/subcategory test catalog against multiple
LLMs through an OpenAI-compatible endpoint. Deterministic evaluators
score each response. Reports render as table, markdown, or JSON.
2026-08-17 01:29:45 +01:00

30 lines
692 B
Go

package eval
import (
"context"
"testing"
)
func TestEquals(t *testing.T) {
tests := []struct {
name string
want string
response string
wantVal float64
}{
{"exact match", "patch", "patch", 1},
{"case insensitive", "PATCH", "patch", 1},
{"trimmed whitespace", "patch", " patch\n", 1},
{"mismatch", "patch", "minor", 0},
{"substring is not equal", "patch", "patch bump", 0},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := Equals(tt.want).Evaluate(context.Background(), tt.response)
if got.Value != tt.wantVal {
t.Errorf("Equals(%q).Evaluate(%q) = %v, want %v", tt.want, tt.response, got.Value, tt.wantVal)
}
})
}
}