aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-24 12:34:20 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-24 12:34:20 +0100
commitb9a670dace9252eaaf3de5871e5a1c6d355989fb (patch)
tree53952699c957a0993c80041b7c1cbdce42491cdc /spec
parentf7614d491a12872231226995f4707fa9ff8dec9a (diff)
downloadprosody-b9a670dace9252eaaf3de5871e5a1c6d355989fb.tar.gz
prosody-b9a670dace9252eaaf3de5871e5a1c6d355989fb.zip
util.ringbuffer: Ensure unsigned chars are always returned from :byte()
Diffstat (limited to 'spec')
-rw-r--r--spec/util_ringbuffer_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/util_ringbuffer_spec.lua b/spec/util_ringbuffer_spec.lua
index 9a50fd20..5657b3f6 100644
--- a/spec/util_ringbuffer_spec.lua
+++ b/spec/util_ringbuffer_spec.lua
@@ -92,5 +92,12 @@ describe("util.ringbuffer", function ()
end
end
end);
+
+ it("works with characters > 127", function ()
+ local b = rb.new();
+ b:write(string.char(0, 140));
+ local r = { b:byte(1, 2) };
+ assert.same({ 0, 140 }, r);
+ end);
end);
end);