diff -r 578c2a83dc18 -r 53f15893a1a7 xmpp_test.go --- a/xmpp_test.go Thu Jan 12 23:14:25 2012 -0700 +++ b/xmpp_test.go Mon Jan 16 20:30:29 2012 -0600 @@ -16,8 +16,8 @@ func TestReadError(t *testing.T) { r := strings.NewReader(``) ch := make(chan interface{}) - go readXml(r, ch, make(map[string] func(*xml.Name) interface{})) - x := <- ch + go readXml(r, ch, make(map[string]func(*xml.Name) interface{})) + x := <-ch se, ok := x.(*streamError) if !ok { t.Fatalf("not StreamError: %v", reflect.TypeOf(x)) @@ -32,8 +32,8 @@ `Error text`) ch = make(chan interface{}) - go readXml(r, ch, make(map[string] func(*xml.Name) interface{})) - x = <- ch + go readXml(r, ch, make(map[string]func(*xml.Name) interface{})) + x = <-ch se, ok = x.(*streamError) if !ok { t.Fatalf("not StreamError: %v", reflect.TypeOf(x)) @@ -50,8 +50,8 @@ `xmlns="jabber:client" xmlns:stream="` + NsStream + `" version="1.0">`) ch := make(chan interface{}) - go readXml(r, ch, make(map[string] func(*xml.Name) interface{})) - x := <- ch + go readXml(r, ch, make(map[string]func(*xml.Name) interface{})) + x := <-ch ss, ok := x.(*stream) if !ok { t.Fatalf("not stream: %v", reflect.TypeOf(x)) @@ -78,15 +78,12 @@ } func TestWriteError(t *testing.T) { - se := &streamError{Any: Generic{XMLName: xml.Name{Local: - "blah"}}} + se := &streamError{Any: Generic{XMLName: xml.Name{Local: "blah"}}} str := testWrite(se) exp := `` assertEquals(t, exp, str) - se = &streamError{Any: Generic{XMLName: xml.Name{Space: - NsStreams, Local: "foo"}}, Text: - &errText{Lang: "ru", Text: "Пошёл ты"}} + se = &streamError{Any: Generic{XMLName: xml.Name{Space: NsStreams, Local: "foo"}}, Text: &errText{Lang: "ru", Text: "Пошёл ты"}} str = testWrite(se) exp = `