Software /
code /
prosody
Diff
spec/util_ringbuffer_spec.lua @ 10953:c3b3ac63f4c3
util.ringbuffer: Ensure unsigned chars are always returned from :byte()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 24 Jun 2020 12:34:20 +0100 |
parent | 10949:8b5b35baf370 |
child | 10954:fc310727adfb |
line wrap: on
line diff
--- a/spec/util_ringbuffer_spec.lua Tue Jun 23 17:59:24 2020 +0200 +++ b/spec/util_ringbuffer_spec.lua Wed Jun 24 12:34:20 2020 +0100 @@ -92,5 +92,12 @@ 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);