Skip to content
Myr

update assert param(expect, actual) position (#1421)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

- update assert param(expect, actual) position

authored by vz · committed by Bo-Yi Wu · parent 1c4cbfa · Browse files · 2 files+10 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−10 removed

  • other:+10 added−10 removed

2 files+10 added−10 removed

modified:errors_test.go+9 added-9 removed
17 unmodified lines
18 Err: baseError,19 Type: ErrorTypePrivate,20 }21 assert.Equal(t, err.Error(), baseError.Error())22 assert.Equal(t, err.JSON(), H{"error": baseError.Error()})22 assert.Equal(t, H{"error": baseError.Error()}, err.JSON())2324 assert.Equal(t, err.SetType(ErrorTypePublic), err)25 assert.Equal(t, err.Type, ErrorTypePublic)25 assert.Equal(t, ErrorTypePublic, err.Type)2627 assert.Equal(t, err.SetMeta("some data"), err)28 assert.Equal(t, err.Meta, "some data")29 assert.Equal(t, err.JSON(), H{28 assert.Equal(t, "some data", err.Meta)29 assert.Equal(t, H{30 "error": baseError.Error(),31 "meta": "some data",32 })32 }, err.JSON())3334 jsonBytes, _ := json.Marshal(err)35 assert.Equal(t, "{\"error\":\"test error\",\"meta\":\"some data\"}", string(jsonBytes))3637 err.SetMeta(H{38 "status": "200",39 "data": "some data",40 })41 assert.Equal(t, err.JSON(), H{41 assert.Equal(t, H{42 "error": baseError.Error(),43 "status": "200",44 "data": "some data",45 })45 }, err.JSON())4647 err.SetMeta(H{48 "error": "custom error",49 "status": "200",50 "data": "some data",51 })52 assert.Equal(t, err.JSON(), H{52 assert.Equal(t, H{53 "error": "custom error",54 "status": "200",55 "data": "some data",56 })56 }, err.JSON())5758 type customError struct {59 status string60 data string
46 unmodified lines
modified:response_writer_test.go+1 added-1 removed
49 unmodified lines
5051 w.WriteHeader(300)52 assert.False(t, w.Written())53 assert.Equal(t, 300, w.Status())54 assert.NotEqual(t, testWritter.Code, 300)54 assert.NotEqual(t, 300, testWritter.Code)5556 w.WriteHeader(-1)57 assert.Equal(t, 300, w.Status())58}
57 unmodified lines