7 "github.com/mjl-/mox/dns"
8 "github.com/mjl-/mox/smtp"
11func tcompare(t *testing.T, got, exp any) {
13 if !reflect.DeepEqual(got, exp) {
14 t.Fatalf("got %v, expected %v", got, exp)
18func TestParse(t *testing.T) {
19 tcompare(t, newParser("<@hosta.int,@jkl.org:userc@d.bar.org>", false, nil).xpath(), smtp.Path{Localpart: "userc", IPDomain: dns.IPDomain{Domain: dns.Domain{ASCII: "d.bar.org"}}})
21 tcompare(t, newParser("e+3Dmc2@example.com", false, nil).xtext(), "e=mc2@example.com")
22 tcompare(t, newParser("", false, nil).xtext(), "")