Skip to content

Commit 15669d3

Browse files
committed
Fix refactoring issue
1 parent 27a8101 commit 15669d3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

stanza/msg_hint_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,33 @@ func TestSerializationHint(t *testing.T) {
3232

3333
func TestUnmarshalHints(t *testing.T) {
3434
// Init message as in the const value
35-
msgConst := stanza.NewMessage(stanza.Attrs{To: "[email protected]/laptop", From: "[email protected]/laptop"})
36-
msgConst.Body = "V unir avtugf pybnx gb uvqr zr sebz gurve fvtug"
37-
msgConst.Extensions = append(msgConst.Extensions, &stanza.HintNoCopy{}, &stanza.HintNoPermanentStore{}, &stanza.HintNoStore{}, &stanza.HintStore{})
35+
msgConstCheck := stanza.NewMessage(stanza.Attrs{To: "[email protected]/laptop", From: "[email protected]/laptop"})
36+
msgConstCheck.Body = "V unir avtugf pybnx gb uvqr zr sebz gurve fvtug"
37+
msgConstCheck.Extensions = append(msgConstCheck.Extensions, &stanza.HintNoCopy{}, &stanza.HintNoPermanentStore{}, &stanza.HintNoStore{}, &stanza.HintStore{})
3838

3939
// Compare message with the const value
4040
msg := stanza.Message{}
41-
err := xml.Unmarshal([]byte(msgConst), &msg)
41+
err := xml.Unmarshal([]byte(msgConstCheck), &msg)
4242
if err != nil {
4343
t.Fatal(err)
4444
}
4545

46-
if msgConst.XMLName.Local != msg.XMLName.Local {
47-
t.Fatalf("message tags do not match. Expected: %s, Actual: %s", msgConst.XMLName.Local, msg.XMLName.Local)
46+
if msgConstCheck.XMLName.Local != msg.XMLName.Local {
47+
t.Fatalf("message tags do not match. Expected: %s, Actual: %s", msgConstCheck.XMLName.Local, msg.XMLName.Local)
4848
}
49-
if msgConst.Body != msg.Body {
50-
t.Fatalf("message bodies do not match. Expected: %s, Actual: %s", msgConst.Body, msg.Body)
49+
if msgConstCheck.Body != msg.Body {
50+
t.Fatalf("message bodies do not match. Expected: %s, Actual: %s", msgConstCheck.Body, msg.Body)
5151
}
5252

53-
if !reflect.DeepEqual(msgConst.Attrs, msg.Attrs) {
53+
if !reflect.DeepEqual(msgConstCheck.Attrs, msg.Attrs) {
5454
t.Fatalf("attributes do not match")
5555
}
5656

57-
if !reflect.DeepEqual(msgConst.Error, msg.Error) {
57+
if !reflect.DeepEqual(msgConstCheck.Error, msg.Error) {
5858
t.Fatalf("attributes do not match")
5959
}
6060
var found bool
61-
for _, ext := range msgConst.Extensions {
61+
for _, ext := range msgConstCheck.Extensions {
6262
for _, strExt := range msg.Extensions {
6363
if reflect.TypeOf(ext) == reflect.TypeOf(strExt) {
6464
found = true

0 commit comments

Comments
 (0)