summaryrefslogtreecommitdiff
path: root/test/behaviour
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour')
-rw-r--r--test/behaviour/settings.zig28
1 files changed, 2 insertions, 26 deletions
diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig
index 4b0245d2..76b60da4 100644
--- a/test/behaviour/settings.zig
+++ b/test/behaviour/settings.zig
@@ -43,30 +43,6 @@ test "settings: Shell refuses a path that is no executable, and bare it goes bac
try std.testing.expectEqualStrings(default, try setting(&s, "Shell"));
}
-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();
- // 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");
- try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet cat\n") != null);
- try s.write("/ctl", "Pet frog\n");
- try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "\nPet frog\n") != null);
- try s.write("/ctl", "Pet off\n");
- 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);
- try std.testing.expect(std.mem.indexOf(u8, try s.read("/ctl"), "Pet ") == null);
-}
-
fn expectHas(text: []const u8, part: []const u8) !void {
if (std.mem.indexOf(u8, text, part) == null) {
std.debug.print("not in it: {s}\n", .{part});
@@ -127,6 +103,8 @@ test "settings: a setting this frontend cannot show says GUI-only, never run as
try std.testing.expectEqualStrings("Fonts is GUI-only, invalid here \"Fonts\"", s.said);
try std.testing.expectEqual(@as(u16, 22), try s.refused("/exec", "Fonts\n"));
try std.testing.expectEqualStrings("Fonts is GUI-only, invalid here", s.said);
+ try std.testing.expectEqual(@as(u16, 22), try s.refused(s.at("/pane/{d}/exec", .{try s.focused()}), "Fonts\n"));
+ try std.testing.expectEqualStrings("Fonts is GUI-only, invalid here", s.said);
}
_ = try s.refused("/ctl", "Liftt on\n");
try std.testing.expectEqualStrings("unknown control message \"Liftt\"", s.said);
@@ -257,8 +235,6 @@ 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;
- // Pet's `off` says it has no pet; it takes a name, not a flip.
- if (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;