Software / code / prosody
Comparison
spec/util_dbuffer_spec.lua @ 10977:29b9b679bdbc
util.dbuffer: Don't use # operator in tests, Lua 5.1 doesn't support __len
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 28 Jun 2020 12:26:04 +0100 |
| parent | 10973:39991e40d1dc |
| child | 10980:eaee72c7afbd |
comparison
equal
deleted
inserted
replaced
| 10976:540f1bc5f082 | 10977:29b9b679bdbc |
|---|---|
| 24 describe(":discard", function () | 24 describe(":discard", function () |
| 25 local b = dbuffer.new(); | 25 local b = dbuffer.new(); |
| 26 it("works", function () | 26 it("works", function () |
| 27 assert.truthy(b:write("hello world")); | 27 assert.truthy(b:write("hello world")); |
| 28 assert.truthy(b:discard(6)); | 28 assert.truthy(b:discard(6)); |
| 29 assert.equal(5, #b); | 29 assert.equal(5, b:length()); |
| 30 assert.equal("world", b:read(5)); | 30 assert.equal("world", b:read(5)); |
| 31 end); | 31 end); |
| 32 end); | 32 end); |
| 33 | 33 |
| 34 describe(":sub", function () | 34 describe(":sub", function () |