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 readXml(r, ch, make(map[xml.Name]reflect.Type)) |
121 go recvXml(r, ch, make(map[xml.Name]reflect.Type)) |
122 obs := <-ch |
122 obs := <-ch |
123 exp := &Message{XMLName: xml.Name{Local: "message", Space: "jabber:client"}, |
123 exp := &Message{XMLName: xml.Name{Local: "message", Space: "jabber:client"}, |
124 Header: Header{To: "a@b.c", Innerxml: "<body>foo!</body>"}, |
124 Header: Header{To: "a@b.c", Innerxml: "<body>foo!</body>"}, |
125 Body: &Generic{XMLName: xml.Name{Local: "body", Space: "jabber:client"}, |
125 Body: &Generic{XMLName: xml.Name{Local: "body", Space: "jabber:client"}, |
126 Chardata: "foo!"}} |
126 Chardata: "foo!"}} |