aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_ringbuffer_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-29 18:11:42 +0200
committerKim Alvefur <zash@zash.se>2020-05-29 18:11:42 +0200
commit0bb1474ce668f50c568e7751ac553cbf0acdba77 (patch)
tree201cf90725615fd50a3a03d260a6aff23a5987a0 /spec/util_ringbuffer_spec.lua
parent838f8ebd5bb26c2c96644af9e4f80ea7e150d976 (diff)
downloadprosody-0bb1474ce668f50c568e7751ac553cbf0acdba77.tar.gz
prosody-0bb1474ce668f50c568e7751ac553cbf0acdba77.zip
util.ringbuffer: Prevent creation of zero-size buffer
Diffstat (limited to 'spec/util_ringbuffer_spec.lua')
-rw-r--r--spec/util_ringbuffer_spec.lua5
1 files changed, 5 insertions, 0 deletions
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();