Skip to content

Commit

Permalink
Better assertion failure messages from request_test.
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanbergen committed Dec 8, 2015
1 parent 44e849a commit 611688b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func testRequest(t *testing.T, name string, rb requestBody, expected []byte) {
if err != nil {
t.Error(err)
} else if !bytes.Equal(packet[headerSize:], expected) {
t.Error("Encoding", name, "failed\ngot ", packet, "\nwant", expected)
t.Error("Encoding", name, "failed\ngot ", packet[headerSize:], "\nwant", expected)
}
// Decoder request
decoded, err := decodeRequest(bytes.NewReader(packet))
Expand All @@ -57,7 +57,7 @@ func testRequest(t *testing.T, name string, rb requestBody, expected []byte) {
} else if decoded.correlationID != 123 || decoded.clientID != "foo" {
t.Errorf("Decoded header is not valid: %v", decoded)
} else if !reflect.DeepEqual(rb, decoded.body) {
t.Errorf("Decoded request does not match the encoded one\nencoded: %v\ndecoded: %v", rb, decoded)
t.Errorf("Decoded request does not match the encoded one\nencoded: %v\ndecoded: %v", rb, decoded.body)
}
}

Expand Down

0 comments on commit 611688b

Please sign in to comment.