summaryrefslogtreecommitdiff
path: root/test/behaviour
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour')
-rw-r--r--test/behaviour/keys.zig18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/behaviour/keys.zig b/test/behaviour/keys.zig
index cfa76aa5..e02b1fa5 100644
--- a/test/behaviour/keys.zig
+++ b/test/behaviour/keys.zig
@@ -16,18 +16,20 @@ test "keys: a prompt's entry and cancellation leave the tag, the body and its cu
const dot = s.at("/pane/{d}/dot", .{n});
try s.replace(tag, " keep");
for ([_]struct { keys: []const u8, shown: []const u8 }{
- .{ .keys = "s", .shown = " /zq" },
- .{ .keys = "|", .shown = " |zq" },
- .{ .keys = alt ++ "|", .shown = " |-zq" },
- .{ .keys = "!", .shown = " !zq" },
- .{ .keys = alt ++ "!", .shown = " !+zq" },
+ .{ .keys = "s", .shown = " s zq" },
+ .{ .keys = "|", .shown = " | zq" },
+ .{ .keys = alt ++ "|", .shown = " A-| zq" },
+ .{ .keys = "!", .shown = " ! zq" },
+ .{ .keys = alt ++ "!", .shown = " A-! zq" },
}) |case| {
try s.write(dot, "6 6");
try s.keys(case.keys);
- // The answer is typed into the prompt's own line, never the tag.
+ // The answer is typed into the tag's head (walk UI), shown in place
+ // of the tag's own text, which it never touches.
try s.keys("zq");
_ = try s.where(case.shown);
- try std.testing.expectEqualStrings("/test.txt keep", try s.read(tag));
+ const head = try s.read(tag);
+ try std.testing.expect(std.mem.startsWith(u8, head, "/test.txt") and std.mem.startsWith(u8, head["/test.txt".len..], case.shown));
try s.keys("\x1b");
try std.testing.expectError(error.NotOnScreen, s.where(case.shown));
try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{n})), " mode:normal "));
@@ -58,8 +60,8 @@ test "keys: a prompt opens whatever the tag already holds" {
try s.keys(key);
try s.keys("zq");
_ = try s.where("zq");
- try std.testing.expectEqualStrings(full, try s.read(tag));
try s.keys("\x1b");
+ try std.testing.expectEqualStrings(full, try s.read(tag));
}
}