diff options
Diffstat (limited to 'libgo/go/net/mail/message_test.go')
-rw-r--r-- | libgo/go/net/mail/message_test.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/libgo/go/net/mail/message_test.go b/libgo/go/net/mail/message_test.go index bbbba6b584a..f0761ab09fb 100644 --- a/libgo/go/net/mail/message_test.go +++ b/libgo/go/net/mail/message_test.go @@ -110,11 +110,16 @@ func TestDateParsing(t *testing.T) { } date, err := hdr.Date() if err != nil { - t.Errorf("Failed parsing %q: %v", test.dateStr, err) - continue + t.Errorf("Header(Date: %s).Date(): %v", test.dateStr, err) + } else if !date.Equal(test.exp) { + t.Errorf("Header(Date: %s).Date() = %+v, want %+v", test.dateStr, date, test.exp) } - if !date.Equal(test.exp) { - t.Errorf("Parse of %q: got %+v, want %+v", test.dateStr, date, test.exp) + + date, err = ParseDate(test.dateStr) + if err != nil { + t.Errorf("ParseDate(%s): %v", test.dateStr, err) + } else if !date.Equal(test.exp) { + t.Errorf("ParseDate(%s) = %+v, want %+v", test.dateStr, date, test.exp) } } } @@ -310,6 +315,16 @@ func TestAddressParsing(t *testing.T) { }, }, }, + // Issue 14866 + { + `"" <emptystring@example.com>`, + []*Address{ + { + Name: "", + Address: "emptystring@example.com", + }, + }, + }, } for _, test := range tests { if len(test.exp) == 1 { |