diff options
| author | Shulhan <ms@kilabit.info> | 2021-03-14 22:37:59 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-03-14 22:40:05 +0700 |
| commit | e7552ad0189f761875bc1c2ca3dd716d43a01e0d (patch) | |
| tree | fd68ec29d23fb9a807a7382088020e3b17d446fd /lib/websocket/request_test.go | |
| parent | 882727d89c8e7f9b9761009ccdca1af8c18d0a30 (diff) | |
| download | pakakeh.go-e7552ad0189f761875bc1c2ca3dd716d43a01e0d.tar.xz | |
all: refactoring the test.Assert and test.AssertBench signature
Previously, the test.Assert and test.AssertBench functions has the
boolean parameter to print the stack trace of test in case its not equal.
Since this parameter is not mandatory and its usually always set to
"true", we remove them from function signature to simplify the call
to Assert and AssertBench.
Diffstat (limited to 'lib/websocket/request_test.go')
| -rw-r--r-- | lib/websocket/request_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/websocket/request_test.go b/lib/websocket/request_test.go index 916db0d9..a5e5fc7c 100644 --- a/lib/websocket/request_test.go +++ b/lib/websocket/request_test.go @@ -18,13 +18,13 @@ func TestRequestReset(t *testing.T) { req.reset() - test.Assert(t, "Request.ID", uint64(0), req.ID, true) - test.Assert(t, "Request.Method", "", req.Method, true) - test.Assert(t, "Request.Target", "", req.Target, true) - test.Assert(t, "Request.Body", "", req.Body, true) - test.Assert(t, "Request.Path", "", req.Path, true) - test.Assert(t, "Request.Params", targetParam{}, req.Params, true) - test.Assert(t, "Request.Query", url.Values{}, req.Query, true) + test.Assert(t, "Request.ID", uint64(0), req.ID) + test.Assert(t, "Request.Method", "", req.Method) + test.Assert(t, "Request.Target", "", req.Target) + test.Assert(t, "Request.Body", "", req.Body) + test.Assert(t, "Request.Path", "", req.Path) + test.Assert(t, "Request.Params", targetParam{}, req.Params) + test.Assert(t, "Request.Query", url.Values{}, req.Query) } func testHandleGet(ctx context.Context, req *Request) (res Response) { @@ -93,11 +93,11 @@ func TestRequestUnpack(t *testing.T) { _, err := c.req.unpack(rootRoutes) if err != nil { - test.Assert(t, "error", c.expErr, err.Error(), true) + test.Assert(t, "error", c.expErr, err.Error()) continue } - test.Assert(t, "Params", c.expParams, c.req.Params, true) - test.Assert(t, "Query", c.expQuery, c.req.Query, true) + test.Assert(t, "Params", c.expParams, c.req.Params) + test.Assert(t, "Query", c.expQuery, c.req.Query) } } |
