Refactor tests

This commit is contained in:
rcorniere
2020-03-06 16:44:01 +01:00
parent 22ba8d1f4e
commit e59a86c380
26 changed files with 1737 additions and 129 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
// Check that we can detect optional session from advertised stream features
func TestSessionFeatures(t *testing.T) {
streamFeatures := stanza.StreamFeatures{Session: stanza.StreamSession{Optional: true}}
streamFeatures := stanza.StreamFeatures{Session: stanza.StreamSession{Optional: &struct{}{}}}
data, err := xml.Marshal(streamFeatures)
if err != nil {
@@ -32,7 +32,7 @@ func TestSessionIQ(t *testing.T) {
if err != nil {
t.Fatalf("failed to create IQ: %v", err)
}
iq.Payload = &stanza.StreamSession{XMLName: xml.Name{Local: "session"}, Optional: true}
iq.Payload = &stanza.StreamSession{XMLName: xml.Name{Local: "session"}, Optional: &struct{}{}}
data, err := xml.Marshal(iq)
if err != nil {