package xmpp // import "gosrc.io/xmpp" import ( "encoding/xml" "testing" "fluux.io/xmpp/iot" ) func TestControlSet(t *testing.T) { packet := ` ` parsedIQ := IQ{} data := []byte(packet) if err := xml.Unmarshal(data, &parsedIQ); err != nil { t.Errorf("Unmarshal(%s) returned error", data) } if cs, ok := parsedIQ.Payload[0].(*iot.ControlSet); !ok { t.Errorf("Paylod is not an iot control set: %v", cs) } }