roster_test.go
changeset 36 9fe022261dcc
child 38 2839fece923e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roster_test.go	Fri Dec 30 21:49:00 2011 -0700
@@ -0,0 +1,25 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package xmpp
+
+import (
+	"testing"
+	"xml"
+)
+
+// This is mostly just tests of the roster data structures.
+
+func TestRosterIqMarshal(t *testing.T) {
+	iq := &RosterIq{Iq: Iq{From: "from", Lang: "en"}, Query:
+		RosterQuery{XMLName: xml.Name{Space: NsRoster, Local:
+				"query"}, Item: []RosterItem{}}}
+	var s Stanza = iq
+	if _, ok := s.(ExtendedStanza) ; !ok {
+		t.Errorf("Not an ExtendedStanza")
+	}
+	exp := `<iq from="from" xml:lang="en"><query xmlns="` +
+		NsRoster + `"></query></iq>`
+	assertMarshal(t, exp, iq)
+}