diff options
Diffstat (limited to 'src/ninep')
| -rw-r--r-- | src/ninep/ctl.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig index 2fa0cd7e..cd8bc6c9 100644 --- a/src/ninep/ctl.zig +++ b/src/ninep/ctl.zig @@ -4477,3 +4477,14 @@ test "the init file reads past a BOM, and every line it fails is a notice and an try testing.expect(!th.logHas(p, "line 4")); try testing.expect(th.logHas(p, "err - init file line 5: ")); } + +test "the init file saved in a pane applies its settings again, and runs none of its commands twice" { + 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 cols = p.ncol; + pardes.exec.reapplyInitFile(p, "/tmp/pardes-init-test/elsewhere", "Theme acme\n"); + try testing.expectEqualStrings("dusk", p.theme().name); + pardes.exec.reapplyInitFile(p, "/tmp/pardes-init-test/init", "Theme acme\nNewcol\n"); + try testing.expectEqualStrings("acme", p.theme().name); + try testing.expectEqual(cols, p.ncol); +} |
