From b7cd2925774e033b08884aa503563f3f1ceb6049 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 6 May 2018 14:47:34 +0200 Subject: [PATCH] add tests for mask read size --- ws/message_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ws/message_test.go b/ws/message_test.go index 2ecc989..04254c4 100644 --- a/ws/message_test.go +++ b/ws/message_test.go @@ -139,6 +139,22 @@ func TestReadEOF(t *testing.T) { "complete extended 64 bits length", []byte{0x82,127, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, false, true, + }, { + "missing mask", + []byte{0x82,0x80}, + true, false, + }, { + "incomplete mask 1", + []byte{0x82,0x80, 0x00}, + true, false, + }, { + "incomplete mask 2", + []byte{0x82,0x80, 0x00, 0x00, 0x00}, + true, false, + },{ + "complete mask", + []byte{0x82,0x80, 0x00, 0x00, 0x00, 0x00}, + false, false, }, }