Commit graph

5 commits

Author SHA1 Message Date
Matthew Wild
44d68caf9a util.dbuffer: Add a bunch of missing test cases
Found via mutation testing.
2022-10-11 11:38:32 +01:00
Matthew Wild
e21e4b2b24 util.dbuffer: Fix bugs, remove multi-char support (more complex than first thought)
Character sequences could be split across chunk boundaries. Would require a bunch
of code to make that work reliably.

Only apply front_consumed on first chunk, and adjust buffer_pos accordingly.
2021-06-29 14:25:57 +01:00
Matthew Wild
4e56658eb3 util.dbuffer: Add read_until() method 2021-06-29 13:48:14 +01:00
Kim Alvefur
d3b3e21720 util.dbuffer: Expose length as :len() method, like strings
Ref #1598
2020-10-12 20:20:02 +02:00
Kim Alvefur
095c4f8344 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
2020-08-24 17:28:48 +02:00