diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/fuzz.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/fuzz.zig b/core/fuzz.zig index 7f4526a7..2d589054 100644 --- a/core/fuzz.zig +++ b/core/fuzz.zig @@ -779,6 +779,21 @@ test "a dump and an image cut, flipped and grown: refused or loaded, never a pan defer p.deinit(); // A reader's walk in it: a union, a fixed array held to its length. p.panes[0].?.trail = pardes.Trail.reader(7, "/x/rank.zig", .{ .line = 3, .col = 2 }); + // A picker kept after its Enter (Pardes.picks: its rows, its query, + // its marks), its list word in the walk; a recipe's word and its + // selections (`%s` then Enter); a search's word and its places. + pardes.Pick.open(p, 0, .list, "Refs", "", "/test.txt:2:1: gamma\n/test.txt:1:1: alpha\n"); + pardes.Pick.landHere(p); + for ("%sa\r/gam\r") |c| p.update(.{ .key = .{ .cp = if (c == '\r') pardes.Key.enter else c, .text = &[_]u8{c} } }); + try testing.expect(p.picks[0] != null and p.panes[0].?.places.started); + var kinds: [3]bool = @splat(false); + for (p.panes[0].?.trail.steps[0..p.panes[0].?.trail.n]) |s| switch (s) { + .list => kinds[0] = true, + .recipe => kinds[1] = true, + .search => kinds[2] = true, + else => {}, + }; + try testing.expect(kinds[0] and kinds[1] and kinds[2]); // A view's tag out of rest in it (View.tag_state): SPC t w remembered // (a group's last leaf), then Help typed into (a scope, a field, hits). for (" tw ?hel") |c| p.update(.{ .key = .{ .cp = c, .text = &[_]u8{c} } }); |
