]> Cypherpunks repositories - gostls13.git/commitdiff
net/mail: add test index to error messages in a recent test
authorAlexandre Cesaro <alexandre.cesaro@gmail.com>
Wed, 2 Dec 2015 22:28:49 +0000 (23:28 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 2 Dec 2015 22:41:51 +0000 (22:41 +0000)
Add the test index so it is easier to find which test case failed.

Change-Id: Ic04682651b26b137355950ff0c51bdbdb1d85a9c
Reviewed-on: https://go-review.googlesource.com/17351
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/mail/message_test.go

index 9fd7923c3481120d0a698e841a07349812462b4f..7dd63044932b98bbdb923de02b07a00f56cb71ee 100644 (file)
@@ -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)
                }
        }
 }