summaryrefslogtreecommitdiff
path: root/test/behaviour/settings.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 02:20:42 -0300
committerGabriel Schneider <[email protected]>2026-11-05 09:54:56 -0300
commitd4485660aa6339dbe546a81f4b543d68dfbfa9ec (patch)
tree58318fd507577faa19b7dc48b523d691e546f8cd /test/behaviour/settings.zig
parent534f7da02ac58e475bb24801d315d7b736bd9c38 (diff)
downloadpardes-d4485660aa6339dbe546a81f4b543d68dfbfa9ec.tar.gz
pardes-d4485660aa6339dbe546a81f4b543d68dfbfa9ec.zip
the four gui unit tests that failed on the base pass: the behaviour tests allow the window's own rows (/status ends in `pointer in|out` on a window; a bare setting word moves a setting, a toggle to its other side and Lift, Crt or ShaderAnimation to their next state, and Shader and Pet, whose off means no file and no pet, take a name, not a flip); the tagline pointer-mapping test puts the workspace tag's text TAG_TEXT_INSET cells in, as it is drawn; the caret test that grew a tag past a row's end goes, as a tag wraps onto rows (up to MAX_TAG_ROWS) and no caret is past one
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/behaviour/settings.zig')
-rw-r--r--test/behaviour/settings.zig17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig
index 9a14ff50..c4d93419 100644
--- a/test/behaviour/settings.zig
+++ b/test/behaviour/settings.zig
@@ -257,8 +257,21 @@ test "settings: every on/off setting the root ctl reads flips when its word is w
const word, const was = .{ line[0..space], line[space + 1 ..] };
const on = std.mem.eql(u8, was, "on");
if (!on and !std.mem.eql(u8, was, "off")) continue;
- try s.write("/ctl", s.at("{s}\n", .{word}));
- try std.testing.expectEqualStrings(s.at("{s} {s}", .{ word, if (on) "off" else "on" }), try setting(&s, word));
+ // Shader's and Pet's `off` say they have no file and no pet; each takes
+ // a name, not a flip.
+ if (std.mem.eql(u8, word, "Shader") or std.mem.eql(u8, word, "Pet")) continue;
+ s.write("/ctl", s.at("{s}\n", .{word})) catch |err| {
+ std.debug.print("a bare {s} (was {s}) was refused\n", .{ word, was });
+ return err;
+ };
+ // A bare word moves the setting: a toggle to its other side, one with
+ // more states (Lift's auto, Crt's level, ShaderAnimation's always) to
+ // the next, never nowhere.
+ const after = try setting(&s, word);
+ try std.testing.expect(std.mem.startsWith(u8, after, word));
+ try std.testing.expect(!std.mem.eql(u8, after, line));
+ if (on) try std.testing.expect(!std.mem.endsWith(u8, after, " on"));
+ if (!on) try std.testing.expect(!std.mem.endsWith(u8, after, " off"));
flipped += 1;
}
try std.testing.expect(flipped > 20);