summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index dc5e8386..c9ce41e1 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2173,6 +2173,20 @@ test "round 39's small refusals: one name an open, small scratches unasked, twin
try testing.expectEqualStrings("f\n", scratch.file.?.content);
}
+test "Get of a file not there says so without asking about unsaved edits; the init file saved says a bad line as startup does" {
+ const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .startup_config = "Theme dusk\n", .startup_config_path = "/tmp/pardes-init-test/init" });
+ defer p.deinit();
+ const pane = try p.setTestFile("x\n");
+ _ = wr(p, Node.of(pane.serial, .body), "unsaved\n");
+ try testing.expect(p.executeBuiltinLine(0, "Get /tmp/pardes-surely-no-such-file.txt"));
+ try testing.expect(th.logHas(p, "no such file"));
+ try testing.expect(!th.logHas(p, "again to discard"));
+ try testing.expect(pane.discard_warned == null);
+ pardes.exec.reapplyInitFile(p, "/tmp/pardes-init-test/init", "Theme acme\nnosuchword 1\nNewcol\n");
+ try testing.expect(th.logHas(p, "err - init file line 2: unknown word \"nosuchword 1\""));
+ try testing.expect(!th.logHas(p, "init file line 3"));
+}
+
test "a body write to a terminal is typed input, not a paste, even to a program that asked for bracketed paste" {
const p = try Pardes.init(testing.allocator, .{ .cols = 90, .rows = 30 });
defer p.deinit();