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 | 512f97b32f8de0878f9a97a385f7105cd7fce5b7 (patch) | |
tree | 53952699c957a0993c80041b7c1cbdce42491cdc /spec | |
parent | 240f8628053e0fd728c720e9bde78760b963f551 (diff) | |
download | prosody-512f97b32f8de0878f9a97a385f7105cd7fce5b7.tar.gz prosody-512f97b32f8de0878f9a97a385f7105cd7fce5b7.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); |