╭ changed ───────────────╮ │src/test/event/admin.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │363 var prng = std.Random.DefaultPrng.init(std.testing.random_seed);│ │364 const user_id = evt.EventWithId.randomId(prng.random()); │ │365 const repo_id = evt.EventWithId.randomId(prng.random()); │ │366 + const repo_id_hex = std.fmt.bytesToHex(repo_id, .lower); │ │367 const fork_id = evt.EventWithId.randomId(prng.random()); │ │368 const fork_id_hex = std.fmt.bytesToHex(fork_id, .lower); │ │369 │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │391 } }, │ │392 }, │ │393 }); │ │394 + │ │395 + const target_path = try std.fs.path.join(allocator, &.{ repos_dir, &repo_id_hex }); │ │396 + defer allocator.free(target_path); │ │397 + var target = try rp.Repo(.xit, fork_repo_opts).init(io, allocator, .{ .path = target_path });│ │398 + defer target.deinit(io, allocator); │ │399 │ │400 const draft_path = try fork.create(fork_repo_opts, io, allocator, repos_dir, &admin, .{ │ │401 .id = fork_id_hex, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │425 try std.testing.expectEqualStrings("add a feature", draft.event.title); │ │426 try std.testing.expectEqual(null, draft.event.patchrev_id); │ │427 │ │422 - const same_path = try fork.create(fork_repo_opts, io, allocator, repos_dir, &admin, .{ │ │423 - .id = fork_id_hex, │ │424 - .user_id = user_id, │ │425 - .repo_id = repo_id, │ │426 - .title = "add a feature", │ │427 - .description = "a draft patch", │ │428 - .tags = "enhancement", │ │429 - .author = author, │ │430 - .timestamp = 4, │ │431 - }); │ │432 - defer allocator.free(same_path); │ │433 - try std.testing.expectEqualStrings(draft_path, same_path); │ │434 - │ │428 var wrong_user_id = user_id; │ │429 wrong_user_id[0] ^= 1; │ │430 try std.testing.expectError(error.InvalidPatchDraft, fork.remove(io, allocator, repos_dir, &admin, &fork_id_hex, &wrong_user_id, author));│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯