From b22fa2638bca470bbd8c5ea4768eb0eaaa3e8195 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 19:14:11 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- test/behaviour/builtins.zig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/behaviour') 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); +} -- cgit v1.3