package html import ( "bytes" "testing" "github.com/kylelemons/godebug/pretty" ) func TestFormValues(t *testing.T) { form := `
` want := map[string][]string{ "text1": []string{ "textvalue1", }, "hidden1": []string{ "hiddenvalue1", }, "repeat1": []string{ "repeatval1", "repeatval2", "repeatval3", }, } values, err := FormValues("#formy", bytes.NewBufferString(form)) if err != nil { t.Errorf("expected nil err: %q", err) } if diff := pretty.Compare(want, values); diff != "" { t.Errorf("Compare(want, got) = %v", diff) } }