a73x

33918901

test: the expect cursor consumes the match, not the buffer

a73x   2026-08-10 07:30

Commit message
test: the expect cursor consumes the match, not the buffer

test/ptyclient.zig
Old New
@@ -141,6 +141,8 @@ test "Expecter: the cursor consumes matches — old bytes cannot satisfy a new e
141 defer e.deinit(alloc); 141 defer e.deinit(alloc);
142 try e.feed(alloc, "row-60 painted live"); 142 try e.feed(alloc, "row-60 painted live");
143 try std.testing.expect(e.match("row-60")); 143 try std.testing.expect(e.match("row-60"));
144 // Advance is past-the-match, not to buffer end: two needles in one chunk must both land.
145 try std.testing.expect(e.match("painted live"));
144 // The same needle again: only NEW bytes may answer. 146 // The same needle again: only NEW bytes may answer.
145 try std.testing.expect(!e.match("row-60")); 147 try std.testing.expect(!e.match("row-60"));
146 try e.feed(alloc, " ... row-60 painted by the scroll view"); 148 try e.feed(alloc, " ... row-60 painted by the scroll view");