# HG changeset patch # User Kim Alvefur # Date 1543590189 -3600 # Node ID 27b62234792a509fd65d28005b27661209183688 # Parent 86c431650dfd3b29bb3803cbef85a1467cbdb9b4# Parent 8154a8841bb2bda1bfcc5fa27ca7d162e680e55a Merge 0.11->trunk diff -r 86c431650dfd -r 27b62234792a .hgtags --- a/.hgtags Thu Nov 29 16:53:22 2018 +0100 +++ b/.hgtags Fri Nov 30 16:03:09 2018 +0100 @@ -66,3 +66,4 @@ 29c6d2681bad9f67d8bd548bb3a7973473bae91e 0.9.14 7ec098b68042f60687f1002e788b34b06048945d 0.10.2 83f3a05c1b1bb9b54b3b153077a06eb02e247c8e 0.11.0 +91856829f18bb8ef7056ca02464122fc6de17807 0.11.1 diff -r 86c431650dfd -r 27b62234792a spec/net_websocket_frames_spec.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/net_websocket_frames_spec.lua Fri Nov 30 16:03:09 2018 +0100 @@ -0,0 +1,56 @@ +describe("net.websocket.frames", function () + local nwf = require "net.websocket.frames"; + + local test_frames = { + simple_empty = { + ["opcode"] = 0; + ["length"] = 0; + ["data"] = ""; + ["FIN"] = false; + ["MASK"] = false; + ["RSV1"] = false; + ["RSV2"] = false; + ["RSV3"] = false; + }; + simple_data = { + ["opcode"] = 0; + ["length"] = 5; + ["data"] = "hello"; + ["FIN"] = false; + ["MASK"] = false; + ["RSV1"] = false; + ["RSV2"] = false; + ["RSV3"] = false; + }; + simple_fin = { + ["opcode"] = 0; + ["length"] = 0; + ["data"] = ""; + ["FIN"] = true; + ["MASK"] = false; + ["RSV1"] = false; + ["RSV2"] = false; + ["RSV3"] = false; + }; + } + + describe("build", function () + local build = nwf.build; + it("works", function () + assert.equal("\0\0", build(test_frames.simple_empty)); + assert.equal("\0\5hello", build(test_frames.simple_data)); + assert.equal("\128\0", build(test_frames.simple_fin)); + end); + end); + + describe("parse", function () + local parse = nwf.parse; + it("works", function () + assert.same(test_frames.simple_empty, parse("\0\0")); + assert.same(test_frames.simple_data, parse("\0\5hello")); + assert.same(test_frames.simple_fin, parse("\128\0")); + end); + end); + +end); + diff -r 86c431650dfd -r 27b62234792a util-src/makefile --- a/util-src/makefile Thu Nov 29 16:53:22 2018 +0100 +++ b/util-src/makefile Fri Nov 30 16:03:09 2018 +0100 @@ -5,7 +5,8 @@ INSTALL_DATA=install -m644 TARGET?=../util/ -ALL=encodings.so hashes.so net.so pposix.so signal.so table.so ringbuffer.so time.so +ALL=encodings.so hashes.so net.so pposix.so signal.so table.so \ + ringbuffer.so time.so poll.so compat.so .ifdef $(RANDOM) ALL+=crand.so