summaryrefslogtreecommitdiff
path: root/test/behaviour/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-06 19:14:11 -0300
committerGabriel Schneider <[email protected]>2026-11-06 20:00:43 -0300
commitb22fa2638bca470bbd8c5ea4768eb0eaaa3e8195 (patch)
tree08d0cc564bfe03861313f0acbf14f91f8dc94cc7 /test/behaviour/builtins.zig
parent2ddd5bcbe8d470c00b045af5822418fe429357bc (diff)
downloadpardes-b22fa2638bca470bbd8c5ea4768eb0eaaa3e8195.tar.gz
pardes-b22fa2638bca470bbd8c5ea4768eb0eaaa3e8195.zip
Build: a word that prints this build into a +Build pane (SPC h b): the version line, the commit, the jj change and the build time (stamped as the commit is: release builds and the ~/.local install, else "not stamped"), the zig that built it, its mode, target, platform and grammars, whether the addons are compiled in, the wire's semantics hash and the dependencies; build.zig stamps the change (jj log -r git_head()) and the time (date -u) through one command helper beside gitCommit; a T1 case reads the pane
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/behaviour/builtins.zig')
-rw-r--r--test/behaviour/builtins.zig16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/behaviour/builtins.zig b/test/behaviour/builtins.zig
index 3c16a4a2..86ee6ca9 100644
--- a/test/behaviour/builtins.zig
+++ b/test/behaviour/builtins.zig
@@ -34,3 +34,19 @@ test "builtins: Mini maps a file of the pane's directory over pardes's own sourc
try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), s.at("ask {d} save path\n", .{mini})) != null);
try std.testing.expectEqual(@as(usize, 0), s.saved);
}
+
+test "builtins: Build prints this build into a +Build pane" {
+ var s = try Session.initFile(std.testing.allocator, "x\n");
+ defer s.deinit();
+ try s.write(s.at("/pane/{d}/exec", .{try s.focused()}), "Build\n");
+ const index = try s.read("/index");
+ var serial: ?u32 = null;
+ var lines = std.mem.splitScalar(u8, index, '\n');
+ while (lines.next()) |line| if (std.mem.indexOf(u8, line, "+Build") != null) {
+ serial = try std.fmt.parseInt(u32, line[0..std.mem.indexOfScalar(u8, line, ' ').?], 10);
+ };
+ const body = try s.read(s.at("/pane/{d}/body", .{serial orelse return error.NoBuildPane}));
+ try std.testing.expect(std.mem.startsWith(u8, body, "pardes "));
+ for ([_][]const u8{ "\ncommit ", "\nchange ", "\nbuilt ", "\nzig 0.17", "\nmode ", "\nplatform ", "\ndependencies\n" }) |want|
+ try std.testing.expect(std.mem.indexOf(u8, body, want) != null);
+}