package xmpp import ( "testing" ) func TestDomainpart(t *testing.T) { var data = map[string]string{ "user@example.org/ressource": "example.org", "example.org/ressource": "example.org", "user@example.org": "example.org", "example.org": "example.org", "test.eu": "test.eu", } for k, v := range(data) { if domainpart(k) != v { t.Fatalf("Domain part of JID '%s' is not '%s'!", k, v) } } }