aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/util_dbuffer_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/util_dbuffer_spec.lua b/spec/util_dbuffer_spec.lua
index b7f80dc9..26fa7da6 100644
--- a/spec/util_dbuffer_spec.lua
+++ b/spec/util_dbuffer_spec.lua
@@ -67,6 +67,15 @@ describe("util.dbuffer", function ()
assert.equals("hello", b:sub(1, 5));
end);
+ pending("works after discard", function ()
+ local b = dbuffer.new(256);
+ assert.truthy(b:write("foo"));
+ assert.truthy(b:write("bar"));
+ assert.equals("foobar", b:sub(1, 6));
+ assert.truthy(b:discard(3)) -- until the space
+ assert.equals("bar", b:sub(1, 3));
+ end);
+
it("supports optional end parameter", function ()
local b = dbuffer.new();
assert.truthy(b:write("hello world"));