summaryrefslogtreecommitdiff
path: root/test/snapshot.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-05 19:32:30 -0300
committerGabriel Schneider <[email protected]>2026-08-10 09:17:07 -0300
commit8aafc3fa24c7475a07259eb06cd5d217f510df98 (patch)
tree62115e1ef1f15c57022060124c5ff934b778e169 /test/snapshot.zig
parent30a44a55232b829866bc3554647de21929276d1a (diff)
downloadpardes-8aafc3fa24c7475a07259eb06cd5d217f510df98.tar.gz
pardes-8aafc3fa24c7475a07259eb06cd5d217f510df98.zip
add a Shell builtin, default fish, with per-family prompt integration
Diffstat (limited to 'test/snapshot.zig')
-rw-r--r--test/snapshot.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/snapshot.zig b/test/snapshot.zig
index 39350bee..36a5b20b 100644
--- a/test/snapshot.zig
+++ b/test/snapshot.zig
@@ -311,6 +311,15 @@ fn runScript(arena: std.mem.Allocator, exe_z: [:0]const u8, script_path: []const
// XDG directory that points outside this per-snapshot fake home.
const config_home = try std.fmt.allocPrintSentinel(arena, "{s}/.config", .{home}, 0);
_ = setenv("XDG_CONFIG_HOME", config_home, 1);
+ // ...and it is not empty: the DEFAULT shell is fish, whose prompt carries
+ // a hostname and whose greeting carries a version, so a golden taken
+ // 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
+ // 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");
_ = setenv("TERM", "xterm-256color", 1);
_ = setenv("LC_ALL", "C", 1);
// a wall clock cannot live in a golden; everything that would print one