0e5cfe2a
docs: sockpath/delta polish — test-scoped import, canServe clause
a73x 2026-08-12 19:28
Commit message
src/delta.zig
| Old | New | ||
|---|---|---|---|
| @@ -135,9 +135,8 @@ pub const DeltaTracker = struct { | |||
| 135 | /// the tracker does not know which daemon instance it belongs to. | 135 | /// the tracker does not know which daemon instance it belongs to. |
| 136 | /// | 136 | /// |
| 137 | /// 0 is never serviceable: it is what a client says when it holds | 137 | /// 0 is never serviceable: it is what a client says when it holds |
| 138 | /// nothing. Neither is any seq against an unbuilt tracker — one that has | 138 | /// nothing. Neither is any seq against a tracker that has never been |
| 139 | /// never been built, or whose rebuild failed partway, can describe | 139 | /// built, or whose rebuild failed partway: it can describe nothing. |
| 140 | /// nothing. | ||
| 141 | pub fn canServe(self: *const DeltaTracker, have_seq: u64) bool { | 140 | pub fn canServe(self: *const DeltaTracker, have_seq: u64) bool { |
| 142 | return have_seq != 0 and | 141 | return have_seq != 0 and |
| 143 | have_seq >= self.reset_seq and have_seq <= self.seq and | 142 | have_seq >= self.reset_seq and have_seq <= self.seq and |
src/sockpath.zig
| Old | New | ||
|---|---|---|---|
| @@ -8,7 +8,6 @@ | |||
| 8 | //! of the daemon. Nothing here knows a Server exists; a path is all it | 8 | //! of the daemon. Nothing here knows a Server exists; a path is all it |
| 9 | //! takes. | 9 | //! takes. |
| 10 | const std = @import("std"); | 10 | const std = @import("std"); |
| 11 | const TmpDir = @import("testtmp").TmpDir; | ||
| 12 | 11 | ||
| 13 | /// A socket file's identity at the moment it was bound, so teardown can | 12 | /// A socket file's identity at the moment it was bound, so teardown can |
| 14 | /// tell our socket from one that replaced it. | 13 | /// tell our socket from one that replaced it. |
| @@ -87,7 +86,8 @@ pub fn claim(path: []const u8) !void { | |||
| 87 | } | 86 | } |
| 88 | 87 | ||
| 89 | test "PathId: names the file it was taken from, not the path, and not a successor" { | 88 | test "PathId: names the file it was taken from, not the path, and not a successor" { |
| 90 | var tmp = try TmpDir.make(); | 89 | const testtmp = @import("testtmp"); |
| 90 | var tmp = try testtmp.TmpDir.make(); | ||
| 91 | defer tmp.cleanup(); | 91 | defer tmp.cleanup(); |
| 92 | 92 | ||
| 93 | var buf: [64]u8 = undefined; | 93 | var buf: [64]u8 = undefined; |