diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-23 15:41:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-23 16:28:34 -0300 |
| commit | 18933ab34ea07f2cf755aa4e8d9bdb4dc25a67a6 (patch) | |
| tree | 9c2831a2ee8fef25364283151ca6ac312dc86ecf /dev/tui | |
| parent | f34d3a74cc4a6b735c98ce98cef0df42bd065e67 (diff) | |
| download | pardes-18933ab34ea07f2cf755aa4e8d9bdb4dc25a67a6.tar.gz pardes-18933ab34ea07f2cf755aa4e8d9bdb4dc25a67a6.zip | |
the boundaries fuzzes and tests, failing first: bytes from outside (garbage and mutated-valid) into the reader that takes them, a fixed seed list and seconds, an error never a panic, memory held by a capped allocator (core/fuzz.zig, in core-test): 9P frames through the engine pardes runs (`runtime.ninep.Server(pardes.ctlfs, runtime.ninep.editor)`), framed as the engine frames them so that no walk reaches `os` (the host files) or `n`, the core effects dropped, a frame drawn after each push (16 seeds x 400 frames, deep: 607 writes, 604 reads in one run); a client inputs into the session reader (`replica.parseInput`, every tag decodeClient) applied with `update` and drawn; a session units recorded by an `Authority`, cut, flipped and grown, replayed by a `Replica` (the client road); a session byte dump and image, damaged, through `dump.check` and `dump.load`; and the sites the note found by reading, each a test: a +Search pane rows style past the syntax kinds (`m 1 1 0 0 0 0 0 3:0+3=7 a.txt`), a Grep row of a file named `a:5000000000:b` (core/Query.zig), a top-down BMP (its height negative, addons/image/image.zig, addon-test), an X10 mouse report with a control byte and an SGR one with button 192 (dev/tui/tui.zig, shell-test); on main (f34d3a74cc4a), Debug, each alone: the rows test `expected .err, found .ok` (drawn: `invalid enum value` at core/File.zig:2079), the session side `integer overflow` at core/draw.zig:282 (joinNotice, a prompt caret on a band of 65535 glyphs: Layer.capacity under a client row metrics), the client side `invalid enum value` at core/tape.zig:458 (`peek`), the Grep row `integer does not fit` at core/Query.zig:1267, the BMP `integer does not fit` (image.zig `info`), the X10 report `integer overflow` at vaxis Parser.zig:792; the 9P fuzz and the dump fuzz pass on main (no panic reached)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/tui')
| -rw-r--r-- | dev/tui/tui.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index d1bbe140..9320e522 100644 --- a/dev/tui/tui.zig +++ b/dev/tui/tui.zig @@ -2917,6 +2917,15 @@ test "a mouse report at row or column 0, or before it, is the window's edge, nev } } +test "an X10 mouse report with a byte below 32, and one with a button no mouse has, are no event, never a panic" { + // A legacy terminal's `ESC [ M` then a control byte: Alt+[, Shift+M, Enter and two keys. + for ([_][]const u8{ "\x1b[M\x0d\x20\x20", "\x1b[M\x20\x0d\x20", "\x1b[M\x20\x20\x1f", "\x1b[<192;1;1M", "\x1b[<195;5;5m" }) |sequence| { + var parser: vaxis.Parser = .{}; + const result = try parser.parse(sequence, std.testing.allocator); + try std.testing.expect(result.event == null and result.n > 0); + } +} + test "a mouse's side buttons, xterm's 8 and 9, are Back and Forward, as SDL's X1 and X2 are" { for ([_]vaxis.Mouse.Button{ .button_8, .button_9 }, [_]pardes.Mouse.Button{ .back, .forward }) |from, to| { const event = mouseEvent(.{ .col = 3, .row = 2, .button = from, .mods = .{}, .type = .press }).?; |
