diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour/modes.zig | 13 | ||||
| -rw-r--r-- | test/behaviour/other_files.zig | 14 | ||||
| -rw-r--r-- | test/behaviour/settings.zig | 9 | ||||
| -rw-r--r-- | test/pdf.zig | 3 |
4 files changed, 9 insertions, 30 deletions
diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig index ef39d912..e615920d 100644 --- a/test/behaviour/modes.zig +++ b/test/behaviour/modes.zig @@ -345,10 +345,9 @@ const Jumps = struct { } }; -test "modes: Ctrl-o keeps to the focused file (JumpScope file), A41 then A1, and leaves it only once it runs out that way; Ctrl-i mirrors it" { +test "modes: Ctrl-o keeps to the focused file, A41 then A1, and leaves it only once it runs out that way; Ctrl-i mirrors it" { var t = try Jumps.init("BABABA"); defer t.s.deinit(); - try std.testing.expect(std.mem.indexOf(u8, try t.s.read("/ctl"), "\nJumpScope file\n") != null); // B81, B41 passed over, kept in their places: A has nothing older than // A1, so the step after it is the nearest place of any file, B1. try std.testing.expectEqualStrings("A41 A1 B1", try t.walk(.key, true)); @@ -372,16 +371,6 @@ test "modes: Ctrl-i retraces a run of Ctrl-o inside one file step for step, back try std.testing.expectEqualStrings("A41 A1", try t.walk(.key, true)); } -test "modes: with JumpScope all, Ctrl-o and Ctrl-i take every place in the order it was jumped to, and bare JumpScope is file again" { - var t = try Jumps.init("ABABA"); - defer t.s.deinit(); - try t.s.write("/ctl", "JumpScope all\n"); - try std.testing.expectEqualStrings("B41 A41 B1 A1", try t.walk(.key, true)); - try std.testing.expectEqualStrings("B1 A41 B41 A81", try t.walk(.key, false)); - try t.s.write("/ctl", "JumpScope\n"); - try std.testing.expect(std.mem.indexOf(u8, try t.s.read("/ctl"), "\nJumpScope file\n") != null); -} - test "modes: from a pane with no file, Ctrl-o and Ctrl-i step through every place" { var t = try Jumps.init("OAOBO"); defer t.s.deinit(); diff --git a/test/behaviour/other_files.zig b/test/behaviour/other_files.zig index ae4c2928..bd8cbccd 100644 --- a/test/behaviour/other_files.zig +++ b/test/behaviour/other_files.zig @@ -150,7 +150,7 @@ test "other-files: Recent's row for a file still open is where its dot is now, n try std.testing.expect(has(rows, "\na.txt:2:3 open\n")); } -test "other-files: a closed file is found again: Recent and /recent list it closed, a look at its row reopens it at its dot, and a jump back does too" { +test "other-files: a closed file is found again: Recent and /recent list it closed, a look at its row reopens it at its dot, and a jump to it does too" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "a.txt", .data = "one\ntwo\nthree\n" }); @@ -181,13 +181,11 @@ test "other-files: a closed file is found again: Recent and /recent list it clos // to it opens it again. try s.write(s.at("/pane/{d}/ctl", .{back}), "Del\n"); try std.testing.expect(has(try listing(&s, "Jumplist"), "(closed)")); - // Every entry in order (JumpScope all): which file has the focus after - // a Del is the layout's to choose, and Back keeps to it first. - try s.write("/ctl", "JumpScope all\n"); - for (0..8) |_| { - if ((try named(&s, "/a.txt")).len > 0) break; - try s.write("/exec", "Back\n"); - } + // The text pane closed too, the keyboard is the +Jumps listing's, + // which has no file to keep to: Back takes the nearest place, the + // closed a.txt's. + try s.write(s.at("/pane/{d}/ctl", .{(try named(&s, "/test.txt"))[0]}), "Del\n"); + try s.write("/exec", "Back\n"); try s.expect(s.at("/pane/{d}/name", .{try s.focused()}), s.at("{s}\n", .{a})); } diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index 113a423b..25a3bc04 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -123,7 +123,7 @@ test "settings: a setting this frontend cannot show says GUI-only, never run as try std.testing.expect(has(try s.read("/ctl"), "\nDumpDir /")); } -test "settings: Back and Forward written to exec keep to the focused file, and JumpScope all, written to ctl, takes every place in order" { +test "settings: Back and Forward written to exec keep to the focused file" { var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "a.txt", .data = std.mem.asBytes(&@as([100][4]u8, @splat("row\n".*))) }); @@ -156,13 +156,6 @@ test "settings: Back and Forward written to exec keep to the focused file, and J .{ "Forward", "/b.txt", 80 }, .{ "Forward", "/a.txt", 80 }, }); - try s.write("/ctl", "JumpScope all\n"); - try std.testing.expect(has(try s.read("/ctl"), "JumpScope all\n")); - try walk(&s, &.{ - .{ "Back", "/b.txt", 80 }, - .{ "Back", "/a.txt", 40 }, - .{ "Forward", "/b.txt", 80 }, - }); } const syntax = @import("pardes_config").syntax_highlighting; diff --git a/test/pdf.zig b/test/pdf.zig index 1b2f2829..da1cb45d 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -2197,7 +2197,7 @@ test "a PDF's jumps: Back after a far jump returns to the exact offset, two plac try std.testing.expectEqual(n, p.jumps.n); } -test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens at its place" { +test "a PDF's jumps keep to the PDF, and a closed PDF reopens at its place" { if (!pdf_enabled) return error.SkipZigTest; // Recent keeps a file by the path it was opened as: a real one here, // as a Look opens one. @@ -2208,7 +2208,6 @@ test "a PDF's jumps: JumpScope file keeps to the PDF, and a closed PDF reopens a const p = try Pardes.init(std.testing.allocator, .{ .file = path, .cols = 80, .rows = 28 }); defer p.deinit(); p.frontend.native_images = true; - try std.testing.expectEqual(config.Runtime.JumpScope.file, p.settings.jump_scope); const doc = p.active; const pane = p.panes[doc].?; try jumpFrame(p); |
