summaryrefslogtreecommitdiff
path: root/test/behaviour/settings.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour/settings.zig')
-rw-r--r--test/behaviour/settings.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig
index 59e6f7c3..e62539e4 100644
--- a/test/behaviour/settings.zig
+++ b/test/behaviour/settings.zig
@@ -5,7 +5,10 @@ const Session = @import("session").Session;
test "settings: Pet is the window's: a terminal's view refuses it, from a pane and the root; a window takes only its pets" {
var s = try Session.initFile(std.testing.allocator, "x\n");
defer s.deinit();
- if (try s.refused("/ctl", "Pet cat\n") == 0) {
+ // Which build, from its options, not from the answer: a terminal's view
+ // taking Pet must fail here, not pass as a window.
+ if (comptime @import("pardes_config").platform == .gui) {
+ try s.write("/ctl", "Pet cat\n");
// A window's: dog is no pet of its, and off is.
try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet cat\n") != null);
_ = try s.refused("/ctl", "Pet dog\n");
@@ -16,6 +19,7 @@ test "settings: Pet is the window's: a terminal's view refuses it, from a pane a
try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet off\n") != null);
return;
}
+ try std.testing.expectEqual(@as(u16, 22), try s.refused("/ctl", "Pet cat\n"));
try std.testing.expect(std.mem.startsWith(u8, s.said, "Pet is GUI-only, invalid here"));
try std.testing.expectEqual(@as(u16, 22), try s.refused(s.at("/pane/{d}/exec", .{try s.focused()}), "Pet cat\n"));
try std.testing.expectEqualStrings("Pet is GUI-only, invalid here", s.said);