mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
parent
687d48da48
commit
8f3d5ab4fb
2 changed files with 2 additions and 0 deletions
|
@ -42,6 +42,7 @@ describe("util.dbuffer", function ()
|
|||
assert.truthy(b:write("hello world"));
|
||||
assert.truthy(b:discard(6));
|
||||
assert.equal(5, b:length());
|
||||
assert.equal(5, b:len());
|
||||
assert.equal("world", b:read(5));
|
||||
end);
|
||||
end);
|
||||
|
|
|
@ -135,6 +135,7 @@ end
|
|||
function dbuffer_methods:length()
|
||||
return self._length;
|
||||
end
|
||||
dbuffer_methods.len = dbuffer_methods.length; -- strings have :len()
|
||||
dynamic_buffer_mt.__len = dbuffer_methods.length; -- support # operator
|
||||
|
||||
function dbuffer_methods:collapse(bytes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue