summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-18 14:21:38 -0300
committerGabriel Schneider <[email protected]>2026-08-18 23:45:30 -0300
commit382abe3dafb872b3e6c9792a9cc0abcf6267e180 (patch)
treee30f47d911561db9b02e714287a1658822c77a09 /test
parentc24a9e40215bc30c68c9db7675f1c6a07d9bbae3 (diff)
downloadpardes-382abe3dafb872b3e6c9792a9cc0abcf6267e180.tar.gz
pardes-382abe3dafb872b3e6c9792a9cc0abcf6267e180.zip
file_watch + builtins + config: richer watch semantics, new builtins, config docs
Diffstat (limited to 'test')
-rw-r--r--test/macos_e2e.swift5
-rw-r--r--test/snapshot.zig6
-rw-r--r--test/snapshots/builtins.golden24
3 files changed, 19 insertions, 16 deletions
diff --git a/test/macos_e2e.swift b/test/macos_e2e.swift
index 93019403..791dd945 100644
--- a/test/macos_e2e.swift
+++ b/test/macos_e2e.swift
@@ -917,12 +917,13 @@ private func buildWorld(stem: String) throws -> String {
let home = "\(base)/home"
let work = "\(base)/cwd"
let configHome = "\(home)/.config"
+ let pardesConfig = "\(configHome)/pardes"
// `New` creates its document under TMPDIR (src/temp_file.zig). Left alone
// that is the per-user /var/folders/... path launchd hands out, which is
// different on every machine and lands verbatim in a pane tag — a golden
// that could only ever pass for whoever generated it.
let tmp = "\(base)/tmp"
- for dir in [base, home, work, configHome, tmp] {
+ for dir in [base, home, work, configHome, pardesConfig, tmp] {
try fm.createDirectory(atPath: dir, withIntermediateDirectories: true)
}
@@ -933,7 +934,7 @@ private func buildWorld(stem: String) throws -> String {
// ...and the config is not empty, because the DEFAULT shell is fish, whose
// prompt carries a hostname and whose greeting carries a version. A golden
// taken against that is a golden for one machine.
- try "Shell bash\n".write(toFile: "\(configHome)/pardes", atomically: true, encoding: .utf8)
+ try "Shell bash\n".write(toFile: "\(pardesConfig)/init", atomically: true, encoding: .utf8)
// The return value is the failure of a memory allocation and nothing else;
// there is no recovery worth writing, and a golden taken in a world that
diff --git a/test/snapshot.zig b/test/snapshot.zig
index 18fc2093..f2d7984c 100644
--- a/test/snapshot.zig
+++ b/test/snapshot.zig
@@ -355,10 +355,12 @@ fn runScript(arena: std.mem.Allocator, exe_z: [:0]const u8, script_path: []const
// against it would be a golden for this machine. Every script here runs
// bash — the .bashrc above pins its prompt to `$ ` — and the fish path is
// covered by shell_bin.zig's unit tests instead. This is an ordinary
- // config file going through the ordinary startup-config path, so it also
+ // config init going through the ordinary startup-config path, so it also
// proves `Shell <name>` is dispatchable from one.
try mkdir(arena, config_home, false);
- try eh.writeFile(try std.fmt.allocPrintSentinel(arena, "{s}/pardes", .{config_home}, 0), "Shell bash\n");
+ const pardes_config = try std.fmt.allocPrint(arena, "{s}/pardes", .{config_home});
+ try mkdir(arena, pardes_config, false);
+ try eh.writeFile(try std.fmt.allocPrintSentinel(arena, "{s}/init", .{pardes_config}, 0), "Shell bash\n");
_ = setenv("TERM", "xterm-256color", 1);
_ = setenv("LC_ALL", "C", 1);
// a wall clock cannot live in a golden; everything that would print one
diff --git a/test/snapshots/builtins.golden b/test/snapshots/builtins.golden
index 10fa04db..985a9aad 100644
--- a/test/snapshots/builtins.golden
+++ b/test/snapshots/builtins.golden
@@ -153,8 +153,6 @@
|
|
| /tmp/pardes-snap/builtins/cwd/+Help New Del
-| 37 SPC l w Lspwhy
-| 38 SPC p ClipPaste
| 39 SPC s d Dump topbar
| 40 SPC s r Restore
| 41 SPC t a Ascii
@@ -177,10 +175,12 @@
| 58 Look enter, right-click
| 59 Exec tab, middle-click
| 60 Msg
-| 61 EffectCode
-| 62 Theme
-| 63 Shell
-| 64
+| 61 ThemeFile
+| 62 DumpThemes
+| 63 EffectCode
+| 64 Theme
+| 65 Shell
+| 66
== snap not-a-picker grid=120x60 cursor=7,58
|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill
| /tmp/pardes-snap/builtins/cwd/notes.txt Save New Del
@@ -214,8 +214,6 @@
|
|
| /tmp/pardes-snap/builtins/cwd/+Help New Del
-| 37 SPC l w Lspwhy
-| 38 SPC p ClipPaste
| 39 SPC s d Dump topbar
| 40 SPC s r Restore
| 41 SPC t a Ascii
@@ -238,10 +236,12 @@
| 58 Look enter, right-click
| 59 Exec tab, middle-click
| 60 Msg
-| 61 EffectCode
-| 62 Theme
-| 63 Shell
-| 64
+| 61 ThemeFile
+| 62 DumpThemes
+| 63 EffectCode
+| 64 Theme
+| 65 Shell
+| 66
== snap window-group grid=120x60 cursor=7,32
|New Newcol Find Grep Help Tutor Dump NextColor Debug Kill
| /tmp/pardes-snap/builtins/cwd/notes.txt Save New Del