Changeset

11046:64713f21ff0e

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
author Kim Alvefur <zash@zash.se>
date Mon, 24 Aug 2020 17:28:48 +0200
parents 11045:8c6bace13229
children 11047:93cdd1ece689
files spec/util_dbuffer_spec.lua
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/spec/util_dbuffer_spec.lua	Mon Aug 24 16:18:13 2020 +0100
+++ b/spec/util_dbuffer_spec.lua	Mon Aug 24 17:28:48 2020 +0200
@@ -69,10 +69,9 @@
 
 		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);