mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
webui, rest: Render UTF-8 addresses correctly, fixes #117
This commit is contained in:
@@ -17,10 +17,14 @@ func TestHashMailboxName(t *testing.T) {
|
||||
|
||||
func TestStringAddressList(t *testing.T) {
|
||||
input := []*mail.Address{
|
||||
{Name: "Fred B. Fish", Address: "fred@fish.org"},
|
||||
{Name: "Fred ß. Fish", Address: "fred@fish.org"},
|
||||
{Name: "User", Address: "user@domain.org"},
|
||||
{Address: "a@b.com"},
|
||||
}
|
||||
want := []string{`"Fred B. Fish" <fred@fish.org>`, `"User" <user@domain.org>`}
|
||||
want := []string{
|
||||
`Fred ß. Fish <fred@fish.org>`,
|
||||
`User <user@domain.org>`,
|
||||
`<a@b.com>`}
|
||||
output := stringutil.StringAddressList(input)
|
||||
if len(output) != len(want) {
|
||||
t.Fatalf("Got %v strings, want: %v", len(output), len(want))
|
||||
|
||||
Reference in New Issue
Block a user