diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-06-24 12:34:20 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-06-24 12:34:20 +0100 |
commit | b9a670dace9252eaaf3de5871e5a1c6d355989fb (patch) | |
tree | 53952699c957a0993c80041b7c1cbdce42491cdc /spec | |
parent | f7614d491a12872231226995f4707fa9ff8dec9a (diff) | |
download | prosody-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.lua | 7 |
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); |