aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-24 17:28:48 +0200
committerKim Alvefur <zash@zash.se>2020-08-24 17:28:48 +0200
commit21ecc6ca399493eb88e75f2979d64a779cd34f50 (patch)
treefdc6fbe3d39d453cd2e62a7316857e03fc259cb1 /spec
parent7fa4cc8de0ffb0a0914c1861987a19cf666febf6 (diff)
downloadprosody-21ecc6ca399493eb88e75f2979d64a779cd34f50.tar.gz
prosody-21ecc6ca399493eb88e75f2979d64a779cd34f50.zip
util.dbuffer: Simplify test case
An earlier theory involved the bug being related to collapsing multiple items, so it exercised that too. Also correct the comment, it referred to the space in "hello world" in an earlier version before the test string was changed to "foobar", which was what was tested in a REPL
Diffstat (limited to 'spec')
-rw-r--r--spec/util_dbuffer_spec.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/util_dbuffer_spec.lua b/spec/util_dbuffer_spec.lua
index 554a7e54..af404042 100644
--- a/spec/util_dbuffer_spec.lua
+++ b/spec/util_dbuffer_spec.lua
@@ -69,10 +69,9 @@ describe("util.dbuffer", function ()
it("works after discard", function ()
local b = dbuffer.new(256);
- assert.truthy(b:write("foo"));
- assert.truthy(b:write("bar"));
+ assert.truthy(b:write("foobar"));
assert.equals("foobar", b:sub(1, 6));
- assert.truthy(b:discard(3)) -- until the space
+ assert.truthy(b:discard(3)); -- consume "foo"
assert.equals("bar", b:sub(1, 3));
end);