2
0
mirror of https://github.com/FluuxIO/go-xmpp synced 2024-11-15 18:13:07 +00:00
go-xmpp/xmpp/jid_test.go

29 lines
445 B
Go
Raw Normal View History

2016-01-06 16:59:44 +00:00
package xmpp
import (
"testing"
)
func TestBareJid(t *testing.T) {
var jid *Jid
var err error
bareJid := "test@domain.com"
if jid, err = NewJid(bareJid); err != nil {
t.Error("could not parse bare jid")
}
if jid.username != "test" {
t.Error("incorrect bare jid username")
}
if jid.domain != "domain.com" {
t.Error("incorrect bare jid domain")
}
if jid.resource != "" {
t.Error("bare jid resource should be empty")
}
}