Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.675 kb
package xmpp;
import (
func TestNewAuth(t *testing.T) {
if auth := NewAuth("", "secret"); auth != nil {
assertEqual(t, "joe", auth.user, "Should parse the user")
assertEqual(t, "", auth.domain, "Should parse the domain")
assertEqual(t, "secret", auth.password, "Should assign password")
} else {
t.Errorf("Expected to parse %s as valid authentication info, but got nil.")
assertPanic(t, "Should not parse auth information with multiple '@'", func() {
NewAuth("", "secret")
assertPanic(t, "Should complain about lack of @", func() {
NewAuth("", "secret")
Jump to Line
Something went wrong with that request. Please try again.