Comparison

spec/util_ringbuffer_spec.lua @ 10898:c6465fb3c839

util.ringbuffer: Prevent creation of zero-size buffer
author Kim Alvefur <zash@zash.se>
date Fri, 29 May 2020 18:11:42 +0200
parent 10897:37df1e757f02
child 10899:8048255ae61e
comparison
equal deleted inserted replaced
10897:37df1e757f02 10898:c6465fb3c839
5 assert.Function(rb.new); 5 assert.Function(rb.new);
6 end); 6 end);
7 it("can be created", function () 7 it("can be created", function ()
8 assert.truthy(rb.new()); 8 assert.truthy(rb.new());
9 end); 9 end);
10 it("won't create an empty buffer", function ()
11 assert.has_error(function ()
12 rb.new(0);
13 end);
14 end);
10 end); 15 end);
11 describe(":write", function () 16 describe(":write", function ()
12 local b = rb.new(); 17 local b = rb.new();
13 it("works", function () 18 it("works", function ()
14 assert.truthy(b:write("hi")); 19 assert.truthy(b:write("hi"));