aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-24 13:00:11 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-24 13:00:11 +0100
commitf3add85e3c05049f24a498fd28783cff54f25b3b (patch)
tree881ecf06e901b588880589d25476b4c4d5c4a3bc /spec
parentb9a670dace9252eaaf3de5871e5a1c6d355989fb (diff)
downloadprosody-f3add85e3c05049f24a498fd28783cff54f25b3b.tar.gz
prosody-f3add85e3c05049f24a498fd28783cff54f25b3b.zip
util.ringbuffer: Add some additional asserts to tests
Diffstat (limited to 'spec')
-rw-r--r--spec/util_ringbuffer_spec.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/util_ringbuffer_spec.lua b/spec/util_ringbuffer_spec.lua
index 5657b3f6..3c052937 100644
--- a/spec/util_ringbuffer_spec.lua
+++ b/spec/util_ringbuffer_spec.lua
@@ -45,20 +45,20 @@ describe("util.ringbuffer", function ()
it("works", function ()
local b = rb.new();
- b:write("hello world");
+ assert.truthy(b:write("hello world"));
assert.equals("hello", b:sub(1, 5));
end);
it("supports optional end parameter", function ()
local b = rb.new();
- b:write("hello world");
+ assert.truthy(b:write("hello world"));
assert.equals("hello world", b:sub(1));
assert.equals("world", b:sub(-5));
end);
it("is equivalent to string:sub", function ()
local b = rb.new(6);
- b:write("foobar");
+ assert.truthy(b:write("foobar"));
b:read(3);
b:write("foo");
for i = -13, 13 do
@@ -79,7 +79,7 @@ describe("util.ringbuffer", function ()
it("is equivalent to string:byte", function ()
local b = rb.new(6);
- b:write("foobar");
+ assert.truthy(b:write("foo"..string.char(0, 140).."obar"));
b:read(3);
b:write("foo");
test_byte(b, 1);