equal
deleted
inserted
replaced
116 |
116 |
117 func TestUnmarshalMessage(t *testing.T) { |
117 func TestUnmarshalMessage(t *testing.T) { |
118 str := `<message to="a@b.c"><body>foo!</body></message>` |
118 str := `<message to="a@b.c"><body>foo!</body></message>` |
119 r := strings.NewReader(str) |
119 r := strings.NewReader(str) |
120 ch := make(chan interface{}) |
120 ch := make(chan interface{}) |
121 go recvXml(r, ch, make(map[xml.Name]reflect.Type)) |
121 cl := &Client{} |
|
122 go cl.recvXml(r, ch, make(map[xml.Name]reflect.Type)) |
122 obs := <-ch |
123 obs := <-ch |
123 exp := &Message{XMLName: xml.Name{Local: "message", Space: "jabber:client"}, |
124 exp := &Message{XMLName: xml.Name{Local: "message", Space: "jabber:client"}, |
124 Header: Header{To: "a@b.c", Innerxml: "<body>foo!</body>"}, |
125 Header: Header{To: "a@b.c", Innerxml: "<body>foo!</body>"}, |
125 Body: &Generic{XMLName: xml.Name{Local: "body", Space: "jabber:client"}, |
126 Body: &Generic{XMLName: xml.Name{Local: "body", Space: "jabber:client"}, |
126 Chardata: "foo!"}} |
127 Chardata: "foo!"}} |