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/frames_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/frames_test.go')
| -rw-r--r-- | lib/websocket/frames_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/websocket/frames_test.go b/lib/websocket/frames_test.go index 22e6379b..3cf0979e 100644 --- a/lib/websocket/frames_test.go +++ b/lib/websocket/frames_test.go @@ -177,7 +177,7 @@ func TestFrameUnpack(t *testing.T) { gots := Unpack(c.in) if gots != nil && len(gots.v) > 0 { - test.Assert(t, "", c.exp, gots.v[0], true) + test.Assert(t, "", c.exp, gots.v[0]) } } } @@ -209,9 +209,8 @@ func TestFramesAppend(t *testing.T) { frames.Append(c.f) - test.Assert(t, "Frames.Len", c.expLen, len(frames.v), true) - test.Assert(t, "Frames.payload", c.expPayload, - string(frames.payload()), true) + test.Assert(t, "Frames.Len", c.expLen, len(frames.v)) + test.Assert(t, "Frames.payload", c.expPayload, string(frames.payload())) } } @@ -247,7 +246,7 @@ func TestFramesIsClosed(t *testing.T) { for _, c := range cases { t.Log(c.desc) got := c.frames.isClosed() - test.Assert(t, "Frames.isClosed", c.exp, got, true) + test.Assert(t, "Frames.isClosed", c.exp, got) } } @@ -329,6 +328,6 @@ func TestFramesPayload(t *testing.T) { got := c.fs.payload() - test.Assert(t, "Frames.payload", c.exp, string(got), true) + test.Assert(t, "Frames.payload", c.exp, string(got)) } } |
