authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-21 12:51:31 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-21 12:51:31 -07:00
log1a7e589937d050d642390d61ef8ed3acdeb2ae9d
tree8be5983fefbb43b52a6489d1c228655da2d78a29
parent2f89b319bf72f797e1d488e2e0e0f16f4ffcfef8

update to Zig 0.14


1 files changed, 33 insertions(+), 28 deletions(-)

test.zig+33-28
......@@ -98,12 +98,14 @@ test {
9898 var git_dir = try std.fs.cwd().openDir(".git", .{});
9999 defer git_dir.close();
100100 try expect(try git.getObject(alloc, git_dir, "5403fecad0fde9120535321f222a061abc2849d9")).toEqualString(
101 \\100644 blob 8e8d2ceba4b327ce9db93f988492d0e21a461012 .gitattributes
102 \\100644 blob bb2a57bd81d13975f2a74ae5dd0e652de07bb8a7 .gitignore
103 \\100644 blob 37be0c1cfa4f097edbb1fb5c0585cd18cb08df13 LICENSE
104 \\100644 blob b229eadbd5d6655c2dfbaca5a5f68f2f8f3c5454 git.zig
105 \\100644 blob bb3f1c135632cfca760bd84fb18acdab8dae8ec3 zig.mod
106 \\
101 // zig fmt: off
102 "100644 blob 8e8d2ceba4b327ce9db93f988492d0e21a461012\t.gitattributes\n" ++
103 "100644 blob bb2a57bd81d13975f2a74ae5dd0e652de07bb8a7\t.gitignore\n" ++
104 "100644 blob 37be0c1cfa4f097edbb1fb5c0585cd18cb08df13\tLICENSE\n" ++
105 "100644 blob b229eadbd5d6655c2dfbaca5a5f68f2f8f3c5454\tgit.zig\n" ++
106 "100644 blob bb3f1c135632cfca760bd84fb18acdab8dae8ec3\tzig.mod\n" ++
107 ""
108 // zig fmt: on
107109 );
108110}
109111
......@@ -138,28 +140,31 @@ test {
138140 var git_dir = try std.fs.cwd().openDir(".git", .{});
139141 defer git_dir.close();
140142 try expect(try git.getTreeDiff(alloc, git_dir, .{ .id = "a542da41f1f0c59fdd0e1527cf5ff9de3f6a0c8e" }, .{ .id = "c39f57f6bb01664a7146ddbfc3debe76ec135f44" })).toEqualString(
141 \\:100644 100644 73c7032166db0eb23c4be11a4ff8ff26ec47c582 b229eadbd5d6655c2dfbaca5a5f68f2f8f3c5454 M git.zig
142 \\
143 \\diff --git a/git.zig b/git.zig
144 \\index 73c7032..b229ead 100644
145 \\--- a/git.zig
146 \\+++ b/git.zig
147 \\@@ -251,10 +251,10 @@ pub fn parseTree(alloc: std.mem.Allocator, treefile: string) !Tree {
148 \\ fn parseTreeMode(input: string) !Tree.Object.Mode {
149 \\ std.debug.assert(input.len == 6);
150 \\ return .{
151 \\- .type = @intToEnum(Tree.Object.Type, try std.fmt.parseInt(u16, input[0..3], 10)),
152 \\- .perm_user = @bitCast(Tree.Object.Perm, try std.fmt.parseInt(u3, input[3..][0..1], 8)),
153 \\- .perm_group = @bitCast(Tree.Object.Perm, try std.fmt.parseInt(u3, input[4..][0..1], 8)),
154 \\- .perm_other = @bitCast(Tree.Object.Perm, try std.fmt.parseInt(u3, input[5..][0..1], 8)),
155 \\+ .type = @enumFromInt(try std.fmt.parseInt(u16, input[0..3], 10)),
156 \\+ .perm_user = @bitCast(try std.fmt.parseInt(u3, input[3..][0..1], 8)),
157 \\+ .perm_group = @bitCast(try std.fmt.parseInt(u3, input[4..][0..1], 8)),
158 \\+ .perm_other = @bitCast(try std.fmt.parseInt(u3, input[5..][0..1], 8)),
159 \\ };
160 \\ }
161 \\
162 ++ " ");
143 // zig fmt: off
144 ":100644 100644 73c7032166db0eb23c4be11a4ff8ff26ec47c582 b229eadbd5d6655c2dfbaca5a5f68f2f8f3c5454 M\tgit.zig\n" ++
145 "\n" ++
146 "diff --git a/git.zig b/git.zig\n" ++
147 "index 73c7032..b229ead 100644\n" ++
148 "--- a/git.zig\n" ++
149 "+++ b/git.zig\n" ++
150 "@@ -251,10 +251,10 @@ pub fn parseTree(alloc: std.mem.Allocator, treefile: string) !Tree {\n" ++
151 " fn parseTreeMode(input: string) !Tree.Object.Mode {\n" ++
152 " std.debug.assert(input.len == 6);\n" ++
153 " return .{\n" ++
154 "- .type = @intToEnum(Tree.Object.Type, try std.fmt.parseInt(u16, input[0..3], 10)),\n" ++
155 "- .perm_user = @bitCast(Tree.Object.Perm, try std.fmt.parseInt(u3, input[3..][0..1], 8)),\n" ++
156 "- .perm_group = @bitCast(Tree.Object.Perm, try std.fmt.parseInt(u3, input[4..][0..1], 8)),\n" ++
157 "- .perm_other = @bitCast(Tree.Object.Perm, try std.fmt.parseInt(u3, input[5..][0..1], 8)),\n" ++
158 "+ .type = @enumFromInt(try std.fmt.parseInt(u16, input[0..3], 10)),\n" ++
159 "+ .perm_user = @bitCast(try std.fmt.parseInt(u3, input[3..][0..1], 8)),\n" ++
160 "+ .perm_group = @bitCast(try std.fmt.parseInt(u3, input[4..][0..1], 8)),\n" ++
161 "+ .perm_other = @bitCast(try std.fmt.parseInt(u3, input[5..][0..1], 8)),\n" ++
162 " };\n" ++
163 " }\n" ++
164 " " ++
165 ""
166 // zig fmt: on
167 );
163168}
164169
165170test {