diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour/root_ctl.zig | 2 | ||||
| -rw-r--r-- | test/behaviour/settings.zig | 2 | ||||
| -rw-r--r-- | test/gui-goldens.txt | 2 | ||||
| -rw-r--r-- | test/monkey9p.zig | 2 | ||||
| -rw-r--r-- | test/process/window.zig | 26 |
5 files changed, 15 insertions, 19 deletions
diff --git a/test/behaviour/root_ctl.zig b/test/behaviour/root_ctl.zig index 7bf15ee2..b9909eef 100644 --- a/test/behaviour/root_ctl.zig +++ b/test/behaviour/root_ctl.zig @@ -63,7 +63,7 @@ test "root-ctl: the root ctl reads the settings as a write takes them, and takes .{ "Nonsense 1", "unknown control message \"Nonsense\"" }, .{ "Verbose maybe", "bad value in control message; takes on, off \"maybe\"" }, // A number's refusal names its range. - .{ "InactiveDim 200", "bad value in control message; takes 0-100 (a percentage) \"200\"" }, + .{ "SearchRows 200", "bad value in control message; takes 1-100 (rows) \"200\"" }, .{ "MessageLinger x", "bad value in control message; takes 0-60000 (milliseconds) \"x\"" }, .{ "Newcol 2", "wrong #args in control message \"Newcol\"" }, .{ "Theme", "wrong #args in control message \"Theme\"" }, diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index 76b60da4..5ad4b7eb 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -93,8 +93,6 @@ test "settings: a setting this frontend cannot show says GUI-only, never run as var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); if (comptime @import("pardes_config").platform != .gui) { - _ = try s.refused("/ctl", "Lift on\n"); - try std.testing.expectEqualStrings("Lift is GUI-only, invalid here \"Lift\"", s.said); _ = try s.refused("/ctl", "GripWidth 120\n"); try std.testing.expectEqualStrings("GripWidth is GUI-only, invalid here \"GripWidth\"", s.said); // A builtin the GUI alone has, written to a ctl or an exec, never diff --git a/test/gui-goldens.txt b/test/gui-goldens.txt index 271b2a0f..6b3960d8 100644 --- a/test/gui-goldens.txt +++ b/test/gui-goldens.txt @@ -14,4 +14,4 @@ 15-theme-acme-light 6e2ba713570d3d2baeaf927218d21f497a43b1d1fc59e7a3eff68f213e5cf7f7 16-debug 776b774f85219e9ced28168e0b90ef4473a8687d1cf14747d21b129dd5aaea98 17-terminal 5f192b2fff53c66d154f4ad310d07c168838172d85cc59ba0fd51720d6abba2e -18-mid-transition 9cfac7223c513df1e15177a69808a0a922e9e6b7fe29c9934754a7e561144d0c +18-mid-transition 14746e3f30abc862e3a25a5f6907d135898cb0f963436f4fe7cd6085eee9a874 diff --git a/test/monkey9p.zig b/test/monkey9p.zig index d87fed07..692550a5 100644 --- a/test/monkey9p.zig +++ b/test/monkey9p.zig @@ -74,7 +74,7 @@ const builtins = [_][]const u8{ "Palette", "Ascii", "Save", "New", "Newcol", "Del", "Filter", "Mode", "Togglettymode", "Edit", "Undo", "Redo", "Collapse", "Delcol", "DelAbove", "DelBelow", "Term", "Repl", "Joincol", "Config", "LocationsConfig", "Messages", "Mini", "Find", "Grep", "Left", "Down", "Up", "Right", "Back", "Forward", "Last", "Recent", "Jumplist", "Colors", "Wrap", "Tagbottom", "Debug", "FocusTint", - "Verbose", "Motion", "InactiveDim", "DumpDir", "Theme", "Get", "Put", "Undo", "Redo", "Zerox", "Snarf", "Paste", "Cut", + "Verbose", "Motion", "SyntaxBold", "DumpDir", "Theme", "Get", "Put", "Undo", "Redo", "Zerox", "Snarf", "Paste", "Cut", "Sort", "Font", "Local", }; const pane_files = [_][]const u8{ "name", "body", "tag", "ctl", "addr", "dot", "limit", "data", "xdata", "sel", "dirty", "mark", "scroll", "errors", "event", "look", "exec", "tagexec", "pty", "pty/run", "pty/data", "pty/ctl", "pty/status" }; diff --git a/test/process/window.zig b/test/process/window.zig index ca91d110..49c2d4f0 100644 --- a/test/process/window.zig +++ b/test/process/window.zig @@ -29,14 +29,12 @@ fn paneWith(f: *process.Files, word: []const u8) !u32 { } const motions = [_][]const u8{ "off", "crisp", "smooth", "bouncy", "playful" }; -const lifts = [_][]const u8{ "off", "shadow", "rim", "auto" }; const themes = [_][]const u8{ "lapis", "lapis_plain", "forge", "acme", "dusk", "daybreak" }; -/// test/gui_monkey.py's: each Motion x Lift gets a random burst, then -/// must settle with its process alive and no crash record. Two -/// combinations and 30 steps in process-test; PARDES_GUI_MONKEY=all runs -/// all 20 (`zig build monkey-gui`), PARDES_GUI_MONKEY_SEED and _STEPS -/// choose the rest. +/// test/gui_monkey.py's: each Motion gets a random burst, then must +/// settle with its process alive and no crash record. Two of them and 30 +/// steps in process-test; PARDES_GUI_MONKEY=all runs all 5 (`zig build +/// monkey-gui`), PARDES_GUI_MONKEY_SEED and _STEPS choose the rest. fn monkey(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try process.only(.gui); const all = std.mem.eql(u8, envOr("PARDES_GUI_MONKEY", ""), "all"); @@ -44,20 +42,20 @@ fn monkey(gpa: std.mem.Allocator, exe: [:0]const u8) !void { const steps = try std.fmt.parseInt(usize, envOr("PARDES_GUI_MONKEY_STEPS", if (all) "60" else "30"), 10); var failed: usize = 0; var n: usize = 0; - for (motions) |m| for (lifts) |l| { + for (motions) |m| { defer n += 1; - // The smoke run: the quietest combination and the busiest. - if (!all and n != 0 and n != motions.len * lifts.len - 1) continue; - if (!try monkeyOne(gpa, exe, m, l, seed * 1000 + n, steps)) failed += 1; - }; + // The smoke run: the quietest and the busiest. + if (!all and n != 0 and n != motions.len - 1) continue; + if (!try monkeyOne(gpa, exe, m, seed * 1000 + n, steps)) failed += 1; + } if (failed > 0) return error.MonkeyFailed; } -fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, lift: []const u8, seed: u64, steps: usize) !bool { +fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, seed: u64, steps: usize) !bool { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); - const init = try std.fmt.allocPrint(a, "Shell /bin/sh\nMessageLinger 0\nMotion {s}\nLift {s}\nPanelSlide\n", .{ motion, lift }); + const init = try std.fmt.allocPrint(a, "Shell /bin/sh\nMessageLinger 0\nMotion {s}\nPanelSlide\n", .{motion}); var d = try process.Detached.start(gpa, exe, "monkey", .{ .init = init, .grid = .{ 80, 28 }, .env = &.{ .{ "PARDES_TEST_CLOCK", "1" }, .{ "PARDES_TEST_PAD", "0" }, } }); @@ -101,7 +99,7 @@ fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, lift }; } else |_| {} const ok = std.mem.eql(u8, verdict, "ok"); - if (!ok) std.debug.print("monkey {s}-{s} (seed {d}): {s}\n{s}", .{ motion, lift, seed, verdict, log.items }); + if (!ok) std.debug.print("monkey {s} (seed {d}): {s}\n{s}", .{ motion, seed, verdict, log.items }); return ok; } |
