aboutsummaryrefslogtreecommitdiff
path: root/lib/websocket/frames_test.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-08-11 16:36:45 +0700
committerShulhan <m.shulhan@gmail.com>2020-08-11 16:36:45 +0700
commit07e8370f158addf23591caa4e268e0fdd0992b44 (patch)
treefad1cca37969f6c0aa01811d8fdf4c4a5b96e349 /lib/websocket/frames_test.go
parent7a6afab5cbd0a02402309fed0ff021d6f9143427 (diff)
downloadpakakeh.go-07e8370f158addf23591caa4e268e0fdd0992b44.tar.xz
websocket: reformat some files
Diffstat (limited to 'lib/websocket/frames_test.go')
-rw-r--r--lib/websocket/frames_test.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/websocket/frames_test.go b/lib/websocket/frames_test.go
index 6669b848..22e6379b 100644
--- a/lib/websocket/frames_test.go
+++ b/lib/websocket/frames_test.go
@@ -33,7 +33,8 @@ func TestFrameUnpack(t *testing.T) {
desc: "A single-frame masked text message",
in: []byte{
0x81, 0x85,
- _testMaskKey[0], _testMaskKey[1], _testMaskKey[2], _testMaskKey[3],
+ _testMaskKey[0], _testMaskKey[1], _testMaskKey[2],
+ _testMaskKey[3],
0x7f, 0x9f, 0x4d, 0x51, 0x58,
},
exp: &Frame{
@@ -82,7 +83,8 @@ func TestFrameUnpack(t *testing.T) {
desc: `Pong without payload`,
in: []byte{
0x8A, 0x80,
- _testMaskKey[0], _testMaskKey[1], _testMaskKey[2], _testMaskKey[3],
+ _testMaskKey[0], _testMaskKey[1], _testMaskKey[2],
+ _testMaskKey[3],
},
exp: &Frame{
fin: frameIsFinished,
@@ -95,7 +97,8 @@ func TestFrameUnpack(t *testing.T) {
desc: `Pong with payload`,
in: []byte{
0x8a, 0x85,
- _testMaskKey[0], _testMaskKey[1], _testMaskKey[2], _testMaskKey[3],
+ _testMaskKey[0], _testMaskKey[1], _testMaskKey[2],
+ _testMaskKey[3],
0x7f, 0x9f, 0x4d, 0x51, 0x58,
},
exp: &Frame{
@@ -109,7 +112,8 @@ func TestFrameUnpack(t *testing.T) {
},
}, {
desc: `256 bytes binary message in a single unmasked frame`,
- in: libbytes.Concat([]byte{0x82, 0x7E, 0x01, 0x00}, _dummyPayload256),
+ in: libbytes.Concat([]byte{0x82, 0x7E, 0x01, 0x00},
+ _dummyPayload256),
exp: &Frame{
fin: frameIsFinished,
opcode: OpcodeBin,
@@ -122,7 +126,8 @@ func TestFrameUnpack(t *testing.T) {
desc: `256 bytes binary message in a single masked frame`,
in: libbytes.Concat([]byte{
0x82, 0xFE, 0x01, 0x00,
- _testMaskKey[0], _testMaskKey[1], _testMaskKey[2], _testMaskKey[3],
+ _testMaskKey[0], _testMaskKey[1], _testMaskKey[2],
+ _testMaskKey[3],
}, _dummyPayload256Masked),
exp: &Frame{
fin: frameIsFinished,
@@ -152,7 +157,8 @@ func TestFrameUnpack(t *testing.T) {
in: libbytes.Concat([]byte{
0x82, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- _testMaskKey[0], _testMaskKey[1], _testMaskKey[2], _testMaskKey[3],
+ _testMaskKey[0], _testMaskKey[1], _testMaskKey[2],
+ _testMaskKey[3],
}, _dummyPayload65536Masked),
exp: &Frame{
fin: frameIsFinished,