~samwhited/xmpp

491b5b772fa09a9a95bbcdf0c21397bc0f5290d8 — Sam Whited 3 years ago 76167c8
all: fix tests
3 files changed, 4 insertions(+), 4 deletions(-)

M ping/example_test.go
M stanza/example_pingstream_test.go
M stanza/stanza_test.go
M ping/example_test.go => ping/example_test.go +1 -1
@@ 24,7 24,7 @@ func Example() {
		log.Fatal(err)
	}
	// Output:
	// <iq to="feste@example.net/siJo4eeT" type="get">
	// <iq type="get" to="feste@example.net/siJo4eeT">
	//	<ping xmlns="urn:xmpp:ping"></ping>
	// </iq>
}

M stanza/example_pingstream_test.go => stanza/example_pingstream_test.go +2 -2
@@ 18,7 18,7 @@ import (
// a ping payload.
func WrapPingIQ(to *jid.JID) xml.TokenReader {
	start := xml.StartElement{Name: xml.Name{Local: "ping", Space: "urn:xmpp:ping"}}
	return stanza.WrapIQ(to, stanza.GetIQ, xmlstream.Wrap(nil, start))
	return stanza.WrapIQ(&stanza.IQ{To: to, Type: stanza.GetIQ}, xmlstream.Wrap(nil, start))
}

func Example_stream() {


@@ 31,7 31,7 @@ func Example_stream() {
		log.Fatal(err)
	}
	// Output:
	// <iq to="feste@example.net/siJo4eeT" type="get">
	// <iq type="get" to="feste@example.net/siJo4eeT">
	//	<ping xmlns="urn:xmpp:ping"></ping>
	// </iq>
}

M stanza/stanza_test.go => stanza/stanza_test.go +1 -1
@@ 58,7 58,7 @@ func TestIQ(t *testing.T) {
		t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
			b := new(bytes.Buffer)
			e := xml.NewEncoder(b)
			iq := stanza.WrapIQ(jid.MustParse(tc.to), tc.typ, tc.payload)
			iq := stanza.WrapIQ(&stanza.IQ{To: jid.MustParse(tc.to), Type: tc.typ}, tc.payload)
			if _, err := xmlstream.Copy(e, iq); err != tc.err {
				t.Errorf("Unexpected error: want=`%v', got=`%v'", tc.err, err)
			}