<commit_before>require'busted'
package.path = package.path..'../src'

local frame = require'websocket.frame'
require'pack'

local bytes = function(...)
   local args = {...}
   local format = string.rep('b',#args)
   return string.pack(format,...)
end

local hello_unmasked = bytes(0x81,0x05,0x48,0x65,0x6c,0x6c,0x6f)
local hello_masked = bytes(0x81,0x85,0x37,0xfa,0x21,0x3d,0x7f,0x9f,0x4d,0x51,0x58)
local hel = bytes(0x01,0x03,0x48,0x65,0x6c)
local lo = bytes(0x80,0x02,0x6c,0x6f)

describe(
   'The frame module',<commit_msg>note rfc<commit_after>require'busted'
package.path = package.path..'../src'

local frame = require'websocket.frame'
require'pack'

local bytes = function(...)
   local args = {...}
   local format = string.rep('b',#args)
   return string.pack(format,...)
end

-- from rfc doc
local hello_unmasked = bytes(0x81,0x05,0x48,0x65,0x6c,0x6c,0x6f)
local hello_masked = bytes(0x81,0x85,0x37,0xfa,0x21,0x3d,0x7f,0x9f,0x4d,0x51,0x58)
local hel = bytes(0x01,0x03,0x48,0x65,0x6c)
local lo = bytes(0x80,0x02,0x6c,0x6f)

describe(
   'The frame module',
{'fraction_non_alphanumeric': 0.16494845360824742, 'fraction_numerical': 0.12933458294283037, 'mean_word_length': 5.512195121951219, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5174617', 'n_tokens_mistral': 541, 'n_tokens_neox': 500, 'n_words': 71}