1 describe("net.websocket.frames", function ()
2 local nwf
= require
"net.websocket.frames";
37 describe("build", function ()
38 local build
= nwf
.build
;
39 it("works", function ()
40 assert.equal("\0\0", build(test_frames
.simple_empty
));
41 assert.equal("\0\5hello", build(test_frames
.simple_data
));
42 assert.equal("\128\0", build(test_frames
.simple_fin
));
46 describe("parse", function ()
47 local parse
= nwf
.parse
;
48 it("works", function ()
49 assert.same(test_frames
.simple_empty
, parse("\0\0"));
50 assert.same(test_frames
.simple_data
, parse("\0\5hello"));
51 assert.same(test_frames
.simple_fin
, parse("\128\0"));