package question // Tests for domain-level fuzzy answer matching threshold behavior and edge cases. import "testing" // TestIsAnswerMatch validates match decisions for exact, near, and below-threshold answers. func TestIsAnswerMatch(t *testing.T) { tests := []struct { name string expected string provided string wantMatch bool }{ {name: "exact", expected: "Paris", provided: "Paris", wantMatch: true}, {name: "near_match", expected: "Leonardo da Vinci", provided: "Leonardo da vinci", wantMatch: true}, {name: "below_threshold", expected: "Jupiter", provided: "Mars", wantMatch: false}, {name: "empty", expected: "", provided: "", wantMatch: true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, _ := IsAnswerMatch(tt.expected, tt.provided) if got != tt.wantMatch { t.Fatalf("got %v want %v", got, tt.wantMatch) } }) } }