package captcha import "testing" func TestDetectHTML(t *testing.T) { tests := []struct { name string html string wantType string wantSolvable bool }{ {"recaptcha v2", `
`, "recaptcha_v2", true}, {"recaptcha v3", ``, "recaptcha_v3", false}, {"hcaptcha", `
`, "hcaptcha", true}, {"turnstile", `
`, "turnstile", false}, {"funcaptcha", `
`, "funcaptcha", true}, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { got := DetectHTML(tc.html) if len(got) == 0 { t.Fatalf("no detection") } if got[0].Type != tc.wantType || got[0].LLMSolvable != tc.wantSolvable { t.Fatalf("got %+v", got[0]) } }) } }