summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 03:56:36 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit34641e435fcbae0af578189760d5ebb05bc07f9a (patch)
tree52957c9fe379df12199b605e68786077d66a68d6 /src
parent79a1e816ceb13ef81b712007716c8add2de75434 (diff)
downloadpardes-34641e435fcbae0af578189760d5ebb05bc07f9a.tar.gz
pardes-34641e435fcbae0af578189760d5ebb05bc07f9a.zip
Term: a core without a terminal boots to a scratch pane, and a test skips only where it needs a terminal (docs/next-terminal.md, Phase 1, the no-terminal core): Pardes.init's shell boots (.shell, .classic, .tty, .tty_shell) are one scratch pane when Term.ops is null, so a test that booted a shell for convenience runs on it, where every one of them skipped before (Term.open refused with SkipZigTest under a test); Term.open refuses with error.NoTerminal, said by errorWords as Term.none, so Term and an exec no shell can take (a command pane) refuse in words (`Term: no terminal in this build`, `exec: ...`), and takesCommandLine is false with no terminal pane; a +Pager pages the bytes as they are (Term.page, unchanged); no boot message: the no-terminal core is a test build alone, read by no person, and a message at boot put seven core tests (the message log, the notice bands, the Del question's wake, a press on a column's rule) out of core-test; a test that fails for want of a terminal says so on its first line (`if (pardes.Term.ops == null) return error.SkipZigTest; // a shell`: a shell, a command pane, the classic boot's three shells, it reads the emulator, ...), 99 tests in 25 files, and ninep/testing.zig's withTerm, the fixture of 29 that assert a terminal pane, once; each attributed by its failure on the scratch boot (NoTerminal from newShell or newCommand, a shell's pane, prompt, pty bytes or tag asserted, the classic boot's panes indexed) and by reading its body; no assertion changes; test: Term.zig ends with the no-terminal core's three (each boot a scratch pane and no terminal; Term, newShell and an exec refused in words, no line typed at a shell; a program's output paged as plain text); core-test (no terminal) 411 passed / 535 skipped of 946 to 810 passed / 139 skipped of 949, shell-test 992: 989 passed, the three no-terminal tests skipped
Diffstat (limited to 'src')
-rw-r--r--src/Core.zig36
-rw-r--r--src/Effect.zig7
-rw-r--r--src/Handover.zig1
-rw-r--r--src/Jump.zig1
-rw-r--r--src/Messages.zig3
-rw-r--r--src/Term.zig53
-rw-r--r--src/builtins.zig1
-rw-r--r--src/draw.zig1
-rw-r--r--src/dump.zig2
-rw-r--r--src/echo.zig4
-rw-r--r--src/edit.zig2
-rw-r--r--src/fs.zig1
-rw-r--r--src/host_io.zig4
-rw-r--r--src/keys.zig1
-rw-r--r--src/layout.zig10
-rw-r--r--src/look.zig4
-rw-r--r--src/mouse.zig4
-rw-r--r--src/ninep/cols.zig4
-rw-r--r--src/ninep/ctl.zig9
-rw-r--r--src/ninep/events.zig1
-rw-r--r--src/ninep/pane.zig3
-rw-r--r--src/ninep/testing.zig1
-rw-r--r--src/ninep/tree.zig1
-rw-r--r--src/panes.zig3
-rw-r--r--src/pardes.zig1
-rw-r--r--src/replica.zig6
-rw-r--r--src/views.zig2
27 files changed, 163 insertions, 3 deletions
diff --git a/src/Core.zig b/src/Core.zig
index ee4420ec..7c550d74 100644
--- a/src/Core.zig
+++ b/src/Core.zig
@@ -526,7 +526,17 @@ fn initSession(gpa: std.mem.Allocator, opts: Options) !*Pardes {
p.boot = Boot.of(opts);
// Asked once, at the start, whoever asks first after.
_ = p.sessionDir();
- switch (p.boot) {
+ // A core built without a terminal (a test configuration: core-test's)
+ // boots to a scratch pane where a shell would have been, and says why
+ // once.
+ const shell_boot = switch (p.boot) {
+ .tty, .tty_shell, .shell, .classic => true,
+ .document, .missing, .stdin => false,
+ };
+ if (pardes.Term.ops == null and shell_boot) {
+ _ = try pardes.panes.newScratch(p, 0, 0, .scratch);
+ p.oneColumn();
+ } else switch (p.boot) {
.document => {
const path = opts.file.?;
const opened = initial_doc: {
@@ -2309,6 +2319,7 @@ test "topbar hover highlights exactly the executable word" {
}
test "pane-tag Exec prefers Term and argument builtins before shell fallback" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .cols = 100, .rows = 30 });
defer p.deinit();
@@ -2531,6 +2542,7 @@ test "Filter is ordered after Del and toggles only its terminal or +Pager pane"
}
test "compact tag commands stay beside their own prefix across layout changes" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .cols = 100, .rows = 30 });
defer p.deinit();
@@ -2575,6 +2587,7 @@ test "compact tag commands stay beside their own prefix across layout changes" {
}
test "Term spawns a raw shell in the caller's directory" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 100, .rows = 30 });
defer p.deinit();
@@ -2600,6 +2613,7 @@ test "Term spawns a raw shell in the caller's directory" {
}
test "a terminal respawned into a closed pane's slot hangs the old shell up first" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
// Hosts keep a shell per slot: were the spawn first, the close would
// end the new shell and leave the old one running.
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 });
@@ -2670,6 +2684,7 @@ test "an empty column shows its theme's empty_col under its tag: acme's white, e
}
test "unknown Exec from a document runs as a command pane in its directory, typed into no terminal" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{});
defer p.deinit();
@@ -2697,6 +2712,7 @@ test "unknown Exec from a document runs as a command pane in its directory, type
}
test "Exec in a terminal whose tty is taken runs as a command pane instead of typing at the program" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{});
defer p.deinit();
@@ -2728,6 +2744,7 @@ test "Exec in a terminal whose tty is taken runs as a command pane instead of ty
}
test "a command of several lines keeps its tag one row, and its echo does not staircase" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 100, .rows = 30 });
defer p.deinit();
@@ -2754,6 +2771,7 @@ test "a command of several lines keeps its tag one row, and its echo does not st
}
test "a spawn is for the pane it was made for, not whatever took the slot since" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true });
defer p.deinit();
@@ -2784,6 +2802,7 @@ test "a spawn is for the pane it was made for, not whatever took the slot since"
}
test "a REPL bound for a language takes the exec made on a body in it; tags, Exec by name and command words still run" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
@@ -3024,6 +3043,7 @@ test "a restored terminal's tag names neither the REPL it was nor the shell it h
}
test "a Term started by a shell's path keeps the path in its Term+ word" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -3034,6 +3054,7 @@ test "a Term started by a shell's path keeps the path in its Term+ word" {
}
test "Tty, Term's old name in saved tags, runs as Term, bare and with its +shell" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -3046,6 +3067,7 @@ test "Tty, Term's old name in saved tags, runs as Term, bare and with its +shell
}
test "Term+fish, one word a tag can hold, opens a terminal on that shell" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -3075,6 +3097,7 @@ test "Term+fish, one word a tag can hold, opens a terminal on that shell" {
}
test "a command pane shows how its command ended, and the next command there runs below it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{});
defer p.deinit();
@@ -3173,6 +3196,7 @@ test "a command pane shows how its command ended, and the next command there run
}
test "a terminal its program gave back takes command lines again" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{});
defer p.deinit();
@@ -3206,6 +3230,7 @@ test "a terminal its program gave back takes command lines again" {
}
test "the host is asked about a tty only where a command line is about to go" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const p = try Pardes.init(std.testing.allocator, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -3369,6 +3394,7 @@ test "startup config overrides restored styling before initFromDump returns" {
}
test "restored terminals keep monotonic nonzero pane identities" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const gpa = std.testing.allocator;
const source = try Pardes.init(gpa, .{ .shells = 3 });
defer source.deinit();
@@ -3663,6 +3689,7 @@ test "argv naming nothing boots an errors pane rather than failing the launch" {
}
test "raw terminal cursor obeys visibility without hiding modal and tag cursors" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 });
defer p.deinit();
@@ -3707,6 +3734,7 @@ test "raw terminal cursor obeys visibility without hiding modal and tag cursors"
}
test "raw terminal cursor follows its active row only while that row is visible" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 });
defer p.deinit();
@@ -3736,6 +3764,7 @@ test "raw terminal cursor follows its active row only while that row is visible"
}
test "the bare tty startup opens a text pane under the shell, unfocused" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .boot = .tty });
defer p.deinit();
try std.testing.expectEqual(Boot.tty, p.boot);
@@ -3804,6 +3833,7 @@ test "tty output follows only from the bottom" {
}
test "an unasked desktop paste reaches a tty pane's program, not its buffer" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
@@ -3822,6 +3852,7 @@ test "an unasked desktop paste reaches a tty pane's program, not its buffer" {
}
test "a paste larger than the effect ring reaches the program whole and in order" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
@@ -3856,6 +3887,7 @@ test "bytes for a terminal past what may wait for it are dropped and said, never
}
test "a bracketed paste larger than the ring still closes its bracket" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
@@ -3878,6 +3910,7 @@ test "a bracketed paste larger than the ring still closes its bracket" {
}
test "a terminal's answer to its program waits behind the paste still queued for its pty" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
@@ -3904,6 +3937,7 @@ test "a terminal's answer to its program waits behind the paste still queued for
}
test "pasted bytes still queued at shutdown are freed, not leaked" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
diff --git a/src/Effect.zig b/src/Effect.zig
index 7f0c3fdf..08694e93 100644
--- a/src/Effect.zig
+++ b/src/Effect.zig
@@ -345,6 +345,7 @@ test "Detach asks the host to let its terminal go, and says so when there is not
}
test "Save on a scratch asks for a path in its inherited dir and makes it a file" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const p = try Pardes.init(std.testing.allocator, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -378,6 +379,7 @@ test "Save on a scratch asks for a path in its inherited dir and makes it a file
}
test "Save on a terminal writes its plaintext scrollback and stays a terminal" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 40, .rows = 8 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -406,6 +408,7 @@ test "Save on a terminal writes its plaintext scrollback and stays a terminal" {
}
test "Save on an output buffer writes its rows out and leaves the buffer alone" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
@@ -458,6 +461,7 @@ test "Save on an output buffer writes its rows out and leaves the buffer alone"
}
test "Save takes the path as an argument, relative to the pane's own directory" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 40, .rows = 8 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -557,6 +561,7 @@ test "Save elsewhere copies a file's bytes and keeps the pane on its own file" {
}
test "saves armed in one batch stay with their own panes" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
@@ -586,6 +591,7 @@ test "saves armed in one batch stay with their own panes" {
}
test "a save whose pane is gone before the drain writes nothing" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
@@ -640,6 +646,7 @@ test "Save reaches every tagline with text behind it and no other" {
}
test "a save path that names no file is refused before anything is rewritten" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const p = try Pardes.init(std.testing.allocator, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
while (p.nextEffect()) |_| {}
diff --git a/src/Handover.zig b/src/Handover.zig
index 2f5689f2..8eb29d5d 100644
--- a/src/Handover.zig
+++ b/src/Handover.zig
@@ -577,6 +577,7 @@ test "a pane edited while it is on its way to another window stays here too" {
}
test "a terminal's grip let go past the edge stays: its shell is this window's" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const p = try Pardes.init(std.testing.allocator, .{ .cols = 100, .rows = 30, .shells = 3 });
defer p.deinit();
p.update(.{ .resize = .{ .cols = 100, .rows = 30 } });
diff --git a/src/Jump.zig b/src/Jump.zig
index 20b001be..2e23d932 100644
--- a/src/Jump.zig
+++ b/src/Jump.zig
@@ -400,6 +400,7 @@ test "Back and Forward take the same steps from the mouse's side buttons and jum
}
test "jump history terminal rectangle follows output and clears on reflow" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // it reads the emulator
const p = try Pardes.init(std.testing.allocator, .{ .cols = 60, .rows = 12, .tty_only = true });
defer p.deinit();
const pane = p.panes[0].?;
diff --git a/src/Messages.zig b/src/Messages.zig
index f400df54..90bedd6f 100644
--- a/src/Messages.zig
+++ b/src/Messages.zig
@@ -382,6 +382,7 @@ pub fn reportError(p: *Pardes, id: usize, operation: []const u8, err: anyerror)
pub fn errorWords(err: anyerror, buf: []u8) []const u8 {
return switch (err) {
error.FileTooLarge => "too large",
+ error.NoTerminal => pardes.Term.none,
error.NotAFile => "not a regular file",
// In the words a mount turns into EISDIR and EACCES (cloud9.fs.enameErrno).
error.IsDirectory => "is a directory",
@@ -575,6 +576,7 @@ test "the message log keeps what the row forgets, and collapses repeats" {
}
test "Msg writes the transient row by hand, bare or with text, and input ends it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const p = try Pardes.init(std.testing.allocator, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -747,6 +749,7 @@ test "messages stack, oldest on top, each on its own timing" {
}
test "a builtin announces itself on the message row, and Verbose silences it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a terminal's tag row
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
const pane = p.panes[p.view().active].?;
diff --git a/src/Term.zig b/src/Term.zig
index 8bd6e05b..cf94c6d5 100644
--- a/src/Term.zig
+++ b/src/Term.zig
@@ -105,9 +105,10 @@ pub fn emulatorOf(s: *State) *@import("term").terminal.State {
// ---- lifecycle ----
/// A new terminal, `cols` by `rows`, allocated with `gpa` (its own from
-/// then on). Refused in a core without one (a test of one skips).
+/// then on). Refused in a core without one: `error.NoTerminal`, which a
+/// word reports as `none` says it.
pub fn open(gpa: std.mem.Allocator, cols: u16, rows: u16) !*State {
- const o = ops orelse return if (builtin.is_test) error.SkipZigTest else error.NoTerminal;
+ const o = ops orelse return error.NoTerminal;
const s = try gpa.create(State);
errdefer gpa.destroy(s);
s.* = .{ .impl = try o.open(gpa, cols, rows) };
@@ -446,3 +447,51 @@ pub fn blank(s: *State, r: *const Replica, lo: u64, hi: u64) void {
pub fn dumpScreen(s: *State, w: *std.Io.Writer) !void {
return the().dumpScreen(s.impl, w);
}
+
+// ---- a core without a terminal (core-test's) ----
+
+test "a core without a terminal boots to a scratch pane" {
+ if (ops != null) return error.SkipZigTest;
+ const pardes = @import("pardes.zig");
+ for ([_]pardes.Options{ .{}, .{ .tty_only = true }, .{ .boot = .tty }, .{ .shells = 3 } }) |opts| {
+ const p = try pardes.Pardes.init(std.testing.allocator, opts);
+ defer p.deinit();
+ const pane = p.panes[0].?;
+ try std.testing.expect(pane.terminal == null);
+ try std.testing.expect(pane.file != null);
+ try std.testing.expectEqual(null, p.panes[1]);
+ }
+}
+
+test "a core without a terminal: Term refuses in words, and no line is typed at a shell" {
+ if (ops != null) return error.SkipZigTest;
+ const pardes = @import("pardes.zig");
+ const p = try pardes.Pardes.init(std.testing.allocator, .{ .file = "mise.toml" });
+ defer p.deinit();
+ try std.testing.expectError(error.NoTerminal, p.newShell(p.freeSlot().?, ""));
+ try std.testing.expect(p.executeBuiltinLine(0, "Term"));
+ const pane = p.panes[0].?;
+ try std.testing.expectEqualStrings("Term: " ++ none, pane.msg[0..pane.msg_len]);
+ // A line no shell can take runs in a command pane, a terminal: refused.
+ try std.testing.expectEqual(null, pardes.exec.execute(p, 0, "make"));
+ try std.testing.expectEqualStrings("exec: " ++ none, pane.msg[0..pane.msg_len]);
+ for (p.panes, 0..) |slot, id| if (slot) |_| try std.testing.expect(!pardes.exec.takesCommandLine(p, id));
+}
+
+test "a core without a terminal pages a program's output as plain text" {
+ if (ops != null) return error.SkipZigTest;
+ const pardes = @import("pardes.zig");
+ const raw = "one\n\x1b[31mtwo\x1b[0m\n";
+ const paged = try page(std.testing.allocator, raw);
+ defer paged.deinit(std.testing.allocator);
+ try std.testing.expectEqualStrings(raw, paged.text);
+ try std.testing.expectEqual(0, paged.spans.len);
+ const p = try pardes.Pardes.init(std.testing.allocator, .{ .stdin_text = "one\ntwo\n" });
+ defer p.deinit();
+ for (p.panes) |slot| if (slot) |pane| if (pane.file) |f| if (f.pager) {
+ try std.testing.expectEqualStrings("one\ntwo\n", f.content);
+ try std.testing.expectEqual(0, f.pager_spans.len);
+ return;
+ };
+ return error.NoPager;
+}
diff --git a/src/builtins.zig b/src/builtins.zig
index 300e196a..e9c91fd8 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -2004,6 +2004,7 @@ test "a Restore's warning is not an Exit's: each word is warned on its own" {
}
test "Kill stops the commands pardes typed, bare all and by name those that match, and never quits" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
while (p.nextEffect()) |_| {}
diff --git a/src/draw.zig b/src/draw.zig
index a73613ac..92bcc592 100644
--- a/src/draw.zig
+++ b/src/draw.zig
@@ -924,6 +924,7 @@ test "a grip's four states, focused or not and clean or dirty, are each its own
}
test "every theme draws a file's name, a +Errors and a Term word in a tint, never the tag's plain ink" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell's Term word
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .cols = 120, .rows = 40, .tty_only = true });
defer p.deinit();
diff --git a/src/dump.zig b/src/dump.zig
index 31765836..d1662e24 100644
--- a/src/dump.zig
+++ b/src/dump.zig
@@ -996,6 +996,7 @@ test "a pane restored with unsaved text is asked about by Exit, Restore, Del and
}
test "a loaded terminal's history stays above its banner, the cursor where it was" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // it reads the emulator
if (comptime isolated) return error.SkipZigTest;
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12 });
@@ -1017,6 +1018,7 @@ test "a loaded terminal's history stays above its banner, the cursor where it wa
}
test "an upgraded session's dump keeps its views and its running terminal as they were, and settings the startup config would change" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell, dumped and loaded
if (comptime isolated) return error.SkipZigTest;
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 12, .startup_config = "Verbose off\n" });
diff --git a/src/echo.zig b/src/echo.zig
index cf7e9ef8..6a18f5dd 100644
--- a/src/echo.zig
+++ b/src/echo.zig
@@ -651,6 +651,7 @@ const Rig = struct {
const prompt = "\x1b]133;A;cl=line;aid=pardes\x07$ \x1b]133;B;aid=pardes\x07";
test "keys typed at a shell's prompt are drawn at once, and the authority's echo takes their place" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // it reads the emulator
var g: Rig = undefined;
try g.init();
defer g.deinit();
@@ -698,6 +699,7 @@ test "keys typed at a shell's prompt are drawn at once, and the authority's echo
}
test "a password prompt shows nothing typed, and a full-screen program is not predicted" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // it reads the emulator
var g: Rig = undefined;
try g.init();
defer g.deinit();
@@ -729,6 +731,7 @@ test "a password prompt shows nothing typed, and a full-screen program is not pr
}
test "keys still on their way when their predictions go: the next waits for their echo, never predicted where it is about to land" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // it reads the emulator
var g: Rig = undefined;
try g.init();
defer g.deinit();
@@ -766,6 +769,7 @@ test "keys still on their way when their predictions go: the next waits for thei
}
test "a misprediction takes every prediction back and shows none until an echo is confirmed; after Tab nothing is predicted until its echo" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // it reads the emulator
var g: Rig = undefined;
try g.init();
defer g.deinit();
diff --git a/src/edit.zig b/src/edit.zig
index 5b94c0d8..23c223d9 100644
--- a/src/edit.zig
+++ b/src/edit.zig
@@ -2311,6 +2311,7 @@ test "insert and normal modes edit complete Unicode graphemes" {
}
test "flat text replacement preserves a terminal fragment origin and direction" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 60, .rows = 12 });
defer p.deinit();
p.update(.{ .output = .{ .pane = 0, .bytes = "first\r\nsecond\r\nthird\r\n界a\r\n" } });
@@ -2438,6 +2439,7 @@ test "a typed edit's known end is where the texts' comparison would find it" {
}
test "a paste into a terminal is xterm's: bracketed when the program asked, control bytes spaces, so no ESC[201~ ends the brackets early" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .cols = 60, .rows = 16, .tty_only = true });
defer p.deinit();
diff --git a/src/fs.zig b/src/fs.zig
index f6bf4fed..855beb25 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -1093,6 +1093,7 @@ test "mount allocation failures preserve prior mounts and release partial copies
}
test "unmount refuses pane paths inherited directories and queued save targets" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try pardes.Pardes.init(gpa, .{ .tty_only = true });
defer p.deinit();
diff --git a/src/host_io.zig b/src/host_io.zig
index 206341f9..b086b5fe 100644
--- a/src/host_io.zig
+++ b/src/host_io.zig
@@ -868,6 +868,7 @@ pub const Lsp = struct {
}
test "a snapshot owns every byte the backend will read" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a terminal pane's snapshot
const gpa = std.testing.allocator;
const core = try pardes.Pardes.init(gpa, .{ .tty_only = true });
defer core.deinit();
@@ -3563,6 +3564,7 @@ test "Kill stops the foreground job, never the shell, and finds none with job co
}
test "a command pane's child is its shell running the one line, and its exit status is read at the end" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
if (comptime !tty_probe_platform) return error.SkipZigTest;
const core = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer core.deinit();
@@ -3585,6 +3587,7 @@ test "a command pane's child is its shell running the one line, and its exit sta
}
test "a command's exit is its process's, told by its watcher, whether or not its pty has ended" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
if (comptime !tty_probe_platform) return error.SkipZigTest;
const core = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer core.deinit();
@@ -3618,6 +3621,7 @@ test "a command's exit is its process's, told by its watcher, whether or not its
}
test "a command's background job outlives it and its pty, and Kill stops its whole line, its & jobs too" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
if (comptime !tty_probe_platform) return error.SkipZigTest;
if (!haveFile("/bin/sh")) return error.SkipZigTest;
const core = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true });
diff --git a/src/keys.zig b/src/keys.zig
index 947954f1..8b67a9d1 100644
--- a/src/keys.zig
+++ b/src/keys.zig
@@ -766,6 +766,7 @@ test "raw tty Ctrl-B switches to editor mode without sending child input" {
}
test "raw tty forwards Ctrl letters and former global shortcuts to the child" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true });
defer p.deinit();
var buf: [256]u8 = undefined;
diff --git a/src/layout.zig b/src/layout.zig
index dfbea067..7719af38 100644
--- a/src/layout.zig
+++ b/src/layout.zig
@@ -1650,6 +1650,7 @@ fn weightsOf(p: *const Pardes) [MAX_COLS]u64 {
}
test "collapse transfers height upward and restores the original layout" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 32 });
defer p.deinit();
_ = try p.newShell(1, "");
@@ -1674,6 +1675,7 @@ test "collapse transfers height upward and restores the original layout" {
}
test "collapse changes only one neighbor at the top middle and bottom" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
for (0..4) |target| {
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 58 });
defer p.deinit();
@@ -1698,6 +1700,7 @@ test "collapse changes only one neighbor at the top middle and bottom" {
}
test "collapse skips folded neighbors and expansion reclaims only its neighbor" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 62 });
defer p.deinit();
for (1..5) |id| {
@@ -1725,6 +1728,7 @@ test "collapse skips folded neighbors and expansion reclaims only its neighbor"
}
test "collapse local transfers remain bounded through repeated tiny window resizes" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 58 });
defer p.deinit();
for (1..5) |id| {
@@ -1772,6 +1776,7 @@ test "collapse expansion is limited to space available in one neighbor" {
}
test "collapse single and all panes leave unused column space" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 32 });
defer p.deinit();
toggleCollapse(p, 0);
@@ -1788,6 +1793,7 @@ test "collapse single and all panes leave unused column space" {
}
test "collapse survives tiny resizes" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 32 });
defer p.deinit();
_ = try p.newShell(1, "");
@@ -1813,6 +1819,7 @@ test "collapse survives tiny resizes" {
}
test "collapse can be expanded by dragging its boundary" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 32 });
defer p.deinit();
_ = try p.newShell(1, "");
@@ -1998,6 +2005,7 @@ test "an attachment survives Dump and Restore, and one left away from its owner
}
test "a new column takes width only from the column that created it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .cols = 124, .rows = 24 });
defer p.deinit();
@@ -2061,6 +2069,7 @@ test "a new column takes width only from the column that created it" {
}
test "Newcol refuses an unsplittable restored weight before spawning" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .cols = 200, .rows = 20 });
defer p.deinit();
@@ -2092,6 +2101,7 @@ test "Newcol refuses an unsplittable restored weight before spawning" {
}
test "repeated non-dyadic column splits preserve every unrelated boundary" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .cols = 979, .rows = 20 });
defer p.deinit();
diff --git a/src/look.zig b/src/look.zig
index b32c46ac..783ff54c 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -1852,6 +1852,7 @@ test "a zero column after a path is found, in every spelling a look takes" {
test "Look hover waits without mutating the pane and input cancels it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const delay = config.look_preview_delay_frames;
const gpa = std.testing.allocator;
@@ -1962,6 +1963,7 @@ test "Look hover waits without mutating the pane and input cancels it" {
}
test "cwd changes cancel only the affected pane's Look hover" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .shells = 3 });
defer p.deinit();
@@ -2481,6 +2483,7 @@ test "Incl's directories find a name found nowhere else, <name> too; bare Incl l
}
test "LookNext in a command pane walks its own file:line places, whoever walked last" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
if (!platform_has_fs) return;
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();
@@ -2678,6 +2681,7 @@ test "Plumb: a look sends what it looks at, the rules written first: a rule's wo
}
test "Plumb: a commit hash looked at in a git work tree is git show's, paged; outside one Diff declines, and the word is searched for" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
if (!platform_has_fs) return;
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();
diff --git a/src/mouse.zig b/src/mouse.zig
index a5ea9bed..8867982c 100644
--- a/src/mouse.zig
+++ b/src/mouse.zig
@@ -1384,6 +1384,7 @@ fn layerCenter(layer: *const Layer, col: u16, comptime tag: bool) [2]f32 {
}
test "a pane's last row of text is no resize handle; the rule over the next pane is" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const p = try twoColumns(std.testing.allocator);
defer p.deinit();
const seam = seamRowOf(p, 1, 0);
@@ -1409,6 +1410,7 @@ test "the line between two columns is no resize handle: a press there is a sweep
}
test "a pane's grip dragged up or down its own column moves its top, down to the floor of the pane above" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try twoColumns(std.testing.allocator);
defer p.deinit();
const upper = p.view().cols[1].panes[0];
@@ -1542,6 +1544,7 @@ test "a chorded exec an event reader holds is told with its argument, and writte
}
test "a wheel over a program that owns it is the program's, in the form it asked for; a shell's scrolls" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .cols = 60, .rows = 16, .tty_only = true });
defer p.deinit();
@@ -1637,6 +1640,7 @@ test "Alt-click is B2 and Super-click B3, kept from the press through the releas
}
test "a program tracking the mouse gets its clicks, drags and moves over its grid as xterm reports them; Shift and chrome stay pardes's" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const p = try Pardes.init(gpa, .{ .cols = 60, .rows = 16, .tty_only = true });
defer p.deinit();
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig
index c8d84e5d..d953bcc7 100644
--- a/src/ninep/cols.zig
+++ b/src/ninep/cols.zig
@@ -435,6 +435,7 @@ test "Help and Find at /tagexec act in the session's directory, not the keyboard
}
test "a shell command at /tagexec or a column's exec is a command pane in the session's directory, never typed into the keyboard's terminal" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 30 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -455,6 +456,7 @@ test "a shell command at /tagexec or a column's exec is a command pane in the se
}
test "New and Term run at /tagexec and a column's exec, with no pane at all too" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
const tagexec = @backingInt(tree.TopFile.tagexec);
@@ -671,6 +673,7 @@ test "tagexec runs a word as a click in the workspace tag; exec files read back
}
test "a word run from the workspace's or a column's tag runs in the session's directory, a pane's in its own" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
const session = p.sessionDir();
@@ -689,6 +692,7 @@ test "a word run from the workspace's or a column's tag runs in the session's di
}
test "a command run from a column's tag gets its pane in that column, not the last" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
layout.newColumn(p, p.view().active);
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index f717fc26..49fe661d 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1879,6 +1879,7 @@ test "Mount dials its peer and fails, mounting nothing, when none answers; a loo
}
test "Term in a directory that is not there fails and makes no pane; a shell that never started answers a run" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
const serial = serialOf(p);
@@ -1971,6 +1972,7 @@ test "a script's Grep and Find fill the pane's one query pane, a row a line unde
}
test "a terminal told the directory it already goes by logs no rename" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
_ = wr(p, Node.of(serialOf(p), .name), "/tmp/f.txt\n");
@@ -2019,6 +2021,7 @@ test "a terminal with text typed at its prompt is never typed into: a look at it
}
test "a command line from a missing directory fails ENOENT and makes no pane; a command whose shell never started ends 127" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
p.host = .{ .vtable = &th.starting };
@@ -2178,6 +2181,7 @@ test "a failure said while a 9P write waits on it posts no msg, only the write's
}
test "with no pane at all, the root look opens its file and the root exec runs in the session's directory" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
var tmp = testing.tmpDir(.{});
@@ -2238,6 +2242,7 @@ test "a restored pane whose file is gone from disk comes back dirty, and Del ask
test "a focus moved over 9P tells the programs that asked for focus reports, as a click does" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(testing.allocator, .{ .cols = 90, .rows = 30, .shells = 2 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -2366,6 +2371,7 @@ test "/recent shows a name as /index does, a newline in it escaped" {
}
test "size is monotonic: growing is never refused, and a size once taken is taken again" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(testing.allocator, .{ .tty_only = true, .cols = 160, .rows = 60 });
defer p.deinit();
while (p.nextEffect()) |_| {}
@@ -2602,6 +2608,7 @@ test "@p<terminal>:<address> takes any address over the terminal's lines, select
}
test "what a /pager open writes after its directory is the text: plain in the body, its colours the pane's, clean, in by the read" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the emulator's parse of colours
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
const pager = @backingInt(tree.TopFile.pager);
@@ -2670,6 +2677,7 @@ test "what a /pager open writes after its directory is the text: plain in the bo
}
test "a command pane an exec open was answered is leased to it while it stays open: another client's command gets a pane of its own" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
const exec = Node.of(serialOf(p), .exec);
@@ -2717,6 +2725,7 @@ test "a body write to an image pane says its body takes none, not that terminals
}
test "Term+bash on a pane ctl is Term with its argument, as exec and the tag take it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
// Tty+sh too: Term's old name, as a saved tag holds it.
diff --git a/src/ninep/events.zig b/src/ninep/events.zig
index 5b5378b1..9e6df93d 100644
--- a/src/ninep/events.zig
+++ b/src/ninep/events.zig
@@ -1306,6 +1306,7 @@ test "after a Restore a new pane or column takes a serial past every one the old
}
test "a pane named before it is announced has its new under that name, and no rename before it" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try withFile(testing.allocator, "one\n");
defer p.deinit();
const pane = p.panes[0].?;
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index 6c86053f..93759aa5 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -1056,6 +1056,7 @@ test "rows through the line index are the ones counting newlines gives, at every
}
test "a terminal's body stats as long as it reads" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = testing.allocator;
const p = try pardes.Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
@@ -1070,6 +1071,7 @@ test "a terminal's body stats as long as it reads" {
}
test "a body write to a terminal pane types at its shell" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 40, .rows = 10 });
defer p.deinit();
@@ -1280,6 +1282,7 @@ test "a limit write that fails keeps the limit a truncation cleared before it" {
}
test "index names a command's pane cmd, a shell's term" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
try testing.expectEqual(Status.ok, wr(p, Node.of(serialOf(p), .exec), "true\n").reply.status);
diff --git a/src/ninep/testing.zig b/src/ninep/testing.zig
index 14aeffea..a9f6d5de 100644
--- a/src/ninep/testing.zig
+++ b/src/ninep/testing.zig
@@ -114,6 +114,7 @@ pub fn withFile(gpa: std.mem.Allocator, text: []const u8) !*Pardes {
}
pub fn withTerm(gpa: std.mem.Allocator) !*Pardes {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
errdefer p.deinit();
while (p.nextEffect()) |_| {}
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig
index e5e521c3..73468ef8 100644
--- a/src/ninep/tree.zig
+++ b/src/ninep/tree.zig
@@ -2146,6 +2146,7 @@ test "a write with no newline waits for its newline or the close, whatever its s
}
test "look and exec read back what their own open's write touched; a fresh open reads the session's last" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell, by Term
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();
const exec = @backingInt(TopFile.exec);
diff --git a/src/panes.zig b/src/panes.zig
index bb026c30..237693fa 100644
--- a/src/panes.zig
+++ b/src/panes.zig
@@ -1559,6 +1559,7 @@ test {
}
test "owned cwd preserves long paths aliases and failed updates" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
var allocator = std.testing.FailingAllocator.init(std.testing.allocator, .{});
const p = try Pardes.init(allocator.allocator(), .{ .tty_only = true });
defer p.deinit();
@@ -1656,6 +1657,7 @@ test "owned cwd close copies are transactional across inherited chains" {
}
test "owned cwd column close allocates every copy before removing any pane" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
var allocator = std.testing.FailingAllocator.init(std.testing.allocator, .{});
const p = try Pardes.init(allocator.allocator(), .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
@@ -1775,6 +1777,7 @@ test "the Tutor pane is named +Tutor in the session's directory, never a bare pa
}
test "New opens an empty scratch below the caller, inheriting its directory" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // the classic boot's three shells
const p = try Pardes.init(std.testing.allocator, .{ .shells = 3, .cols = 100, .rows = 30 });
defer p.deinit();
while (p.nextEffect()) |_| {}
diff --git a/src/pardes.zig b/src/pardes.zig
index 0e05140e..07e612e5 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -329,6 +329,7 @@ pub const Boot = Pardes.Boot;
pub const Haptic = Pardes.Haptic;
test "a compact tagline anchors at its own pane, and both shells step from the same origin" {
+ if (Term.ops == null) return error.SkipZigTest; // a shell
const p = try Pardes.init(std.testing.allocator, .{ .cols = 120, .rows = 24 });
defer p.deinit();
_ = try p.newShell(1, "");
diff --git a/src/replica.zig b/src/replica.zig
index a60f54af..5513b2d9 100644
--- a/src/replica.zig
+++ b/src/replica.zig
@@ -3399,6 +3399,7 @@ test "another client's input first: a replica rolls back, replays it and applies
}
test "a delta applied under a speculation outlives its rollback: the terminal stays the authority's newest" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .boot = .tty }, TestHost.host(), true);
defer a.deinit();
@@ -3487,6 +3488,7 @@ test "a delta applied under a speculation outlives its rollback: the terminal st
}
test "a closed terminal brought back on a screen-state replica: its emulator on the C heap, never the rollback epoch's" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .boot = .tty }, TestHost.host(), true);
defer a.deinit();
@@ -3511,6 +3513,7 @@ test "a closed terminal brought back on a screen-state replica: its emulator on
}
test "a view that sized a terminal closing leaves nothing queued: the others' replicas copy, type and agree" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const a = try Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty }, TestHost.host(), true);
defer a.deinit();
@@ -3557,6 +3560,7 @@ test "a view that sized a terminal closing leaves nothing queued: the others' re
}
test "a terminal sized again by a client's key: the step reads the grid it had, on both sides" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const a = try Authority.init(gpa, .{ .cols = 50, .rows = 20, .boot = .tty }, TestHost.host(), true);
defer a.deinit();
@@ -3636,6 +3640,7 @@ test "a terminal sized again by a client's key: the step reads the grid it had,
}
test "pardes's own keys over a terminal's history apply at once: its view moves here, a delta while they wait puts them on top again, the authority's ends the same" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .boot = .tty }, TestHost.host(), true);
defer a.deinit();
@@ -4240,6 +4245,7 @@ test "a client joined from a dump makes a `/` query's rows as the session does,
}
test "a step that reads a terminal's rows as the core keeps them sends a new client the ones it holds as holes" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = std.testing.allocator;
const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .boot = .tty }, PtyHost.host(), true);
defer a.deinit();
diff --git a/src/views.zig b/src/views.zig
index dbe7e54c..3cdbc8aa 100644
--- a/src/views.zig
+++ b/src/views.zig
@@ -642,6 +642,7 @@ test "registers are the session's: yanked in one view, put in another" {
}
test "a terminal shown at two sizes takes the size of the view that typed into it last" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
@@ -837,6 +838,7 @@ test "a view not live keeps its place in a text another view edits" {
}
test "a terminal shown in a view shorter than it keeps its cursor in sight" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a shell
const gpa = testing.allocator;
const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 20 });
defer p.deinit();