1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-28 10:15:23 +00:00

fix byte assertion

This commit is contained in:
Darien Raymond 2017-02-07 23:33:02 +01:00
parent 8b1bedc607
commit d2538839af
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -25,11 +25,12 @@ type BytesSubject struct {
func (subject *BytesSubject) Equals(expectation []byte) { func (subject *BytesSubject) Equals(expectation []byte) {
if len(subject.value) != len(expectation) { if len(subject.value) != len(expectation) {
subject.FailWithMessage(fmt.Sprint("Bytes arrays have differen size: expected", len(expectation), ", actual", len(subject.value))) subject.FailWithMessage(fmt.Sprint("Bytes arrays have differen size: expected ", len(expectation), ", actual ", len(subject.value)))
return
} }
for idx, b := range expectation { for idx, b := range expectation {
if subject.value[idx] != b { if subject.value[idx] != b {
subject.FailWithMessage(fmt.Sprint("Bytes are different:", b, "vs", subject.value[idx])) subject.FailWithMessage(fmt.Sprint("Bytes are different: ", b, " vs ", subject.value[idx]))
return return
} }
} }