Commit 69c09afb authored by Alexandre Cesaro's avatar Alexandre Cesaro Committed by Brad Fitzpatrick

net/mail: add test index to error messages in a recent test

Add the test index so it is easier to find which test case failed.

Change-Id: Ic04682651b26b137355950ff0c51bdbdb1d85a9c
Reviewed-on: https://go-review.googlesource.com/17351Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent e65db59c
......@@ -613,17 +613,17 @@ func TestAddressFormattingAndParsing(t *testing.T) {
&Address{Name: "naé, mée", Address: "test.mail@gmail.com"},
}
for _, test := range tests {
for i, test := range tests {
parsed, err := ParseAddress(test.String())
if err != nil {
t.Errorf("ParseAddr(%q) error: %v", test.String(), err)
t.Errorf("test #%d: ParseAddr(%q) error: %v", i, test.String(), err)
continue
}
if parsed.Name != test.Name {
t.Errorf("Parsed name = %q; want %q", parsed.Name, test.Name)
t.Errorf("test #%d: Parsed name = %q; want %q", i, parsed.Name, test.Name)
}
if parsed.Address != test.Address {
t.Errorf("Parsed address = %q; want %q", parsed.Address, test.Address)
t.Errorf("test #%d: Parsed address = %q; want %q", i, parsed.Address, test.Address)
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment