Changeset

9662:27b62234792a

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 30 Nov 2018 16:03:09 +0100
parents 9659:86c431650dfd (current diff) 9661:8154a8841bb2 (diff)
children 9666:270216874740
files
diffstat 3 files changed, 59 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
--- /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);
+
--- 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