You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
445 B
29 lines
445 B
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")
|
|
}
|
|
}
|