diff -r 626c390682fc -r b4bd77d58a3e xmpp/structs_test.go --- a/xmpp/structs_test.go Sun Feb 09 09:50:38 2014 -0700 +++ b/xmpp/structs_test.go Sun Feb 09 09:52:28 2014 -0700 @@ -23,28 +23,19 @@ } func TestJid(t *testing.T) { - str := "user@domain/res" - jid := &JID{} - if err := jid.Set(str); err != nil { - t.Errorf("Set(%s) failed: %s", str, err) - } - assertEquals(t, "user", jid.Node) - assertEquals(t, "domain", jid.Domain) - assertEquals(t, "res", jid.Resource) - assertEquals(t, str, jid.String()) + jid := JID("user@domain/res") + assertEquals(t, "user", jid.Node()) + assertEquals(t, "domain", jid.Domain()) + assertEquals(t, "res", jid.Resource()) - str = "domain.tld" - if err := jid.Set(str); err != nil { - t.Errorf("Set(%s) failed: %s", str, err) + jid = "domain.tld" + if jid.Node() != "" { + t.Errorf("Node: %v\n", jid.Node()) } - if jid.Node != "" { - t.Errorf("Node: %v\n", jid.Node) + assertEquals(t, "domain.tld", jid.Domain()) + if jid.Resource() != "" { + t.Errorf("Resource: %v\n", jid.Resource()) } - assertEquals(t, "domain.tld", jid.Domain) - if jid.Resource != "" { - t.Errorf("Resource: %v\n", jid.Resource) - } - assertEquals(t, str, jid.String()) } func assertMarshal(t *testing.T, expected string, marshal interface{}) { @@ -108,8 +99,8 @@ } func TestMarshalEscaping(t *testing.T) { - msg := &Message{Body: &Generic{XMLName: xml.Name{Local: "body"}, - Chardata: `&