From 73efa2f2f174f699ddb4a56320dc6fbb681e5be1 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Fri, 29 May 2020 18:11:42 +0200
Subject: util.ringbuffer: Prevent creation of zero-size buffer

---
 spec/util_ringbuffer_spec.lua | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'spec')

diff --git a/spec/util_ringbuffer_spec.lua b/spec/util_ringbuffer_spec.lua
index 5d63b24b..ccb5493a 100644
--- a/spec/util_ringbuffer_spec.lua
+++ b/spec/util_ringbuffer_spec.lua
@@ -7,6 +7,11 @@ describe("util.ringbuffer", function ()
 		it("can be created", function ()
 			assert.truthy(rb.new());
 		end);
+		it("won't create an empty buffer", function ()
+			assert.has_error(function ()
+				rb.new(0);
+			end);
+		end);
 	end);
 	describe(":write", function ()
 		local b = rb.new();
-- 
cgit v1.2.3