spec/util_dbuffer_spec.lua
changeset 11048 7b720a815519
parent 11032 d7a403060946
child 11049 8c6bace13229
--- a/spec/util_dbuffer_spec.lua	Sun Aug 23 22:19:29 2020 +0200
+++ b/spec/util_dbuffer_spec.lua	Mon Aug 24 17:07:37 2020 +0200
@@ -67,6 +67,15 @@
 			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"));