╭ changed ─────────╮ │src/test/event.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────╮ │1 const std = @import("std");│ │2 const hx = @import("haxy");│ │3 const evt = hx.event; │ │4 -const usr = evt.user; │ │4 const xit = hx.xit; │ │5 const rp = xit.repo; │ │6 const hash = xit.hash; │ ╰──────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────╮ │41 │ │42 var prng = std.Random.DefaultPrng.init(std.testing.random_seed);│ │43 │ │45 - const first_event_id = evt.randomId(prng.random()); │ │44 + const first_event_id = evt.Event.randomId(prng.random()); │ │45 │ │46 const events_to_consume = [_]evt.Event{ │ │47 .{ │ ╰────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │66 }, │ │67 }, │ │68 .{ │ │70 - .id = std.fmt.bytesToHex(evt.randomId(prng.random()), .lower), │ │69 + .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower),│ │70 .data = .{ │ │71 .issue = .{ │ │72 .title = "Search results ignore archived project filter", │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │76 }, │ │77 }, │ │78 .{ │ │80 - .id = std.fmt.bytesToHex(evt.randomId(prng.random()), .lower), │ │79 + .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower),│ │80 .data = .{ │ │81 .issue = .{ │ │82 .title = "Issue list does not persist selected sort order", │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │146 // get the issue out of the map that was edited │ │147 const first_issue_cursor = try event_id_to_issue.getCursor(hash.hashInt(repo_opts.hash, &first_event_id)) orelse return error.NotFound;│ │148 const first_issue_map = try Repo.DB.HashMap(.read_only).init(first_issue_cursor); │ │150 - const first_issue = try evt.EventData.read(Repo.DB, repo_opts.hash, arena.allocator(), first_issue_map, .issue); │ │149 + const first_issue = try evt.Issue.read(Repo.DB, repo_opts.hash, &arena, first_issue_map); │ │150 │ │151 // the description was correctly edited │ │153 - try std.testing.expectEqualStrings(events_to_consume[1].data.issue.?.description, first_issue.issue.description); │ │152 + try std.testing.expectEqualStrings(events_to_consume[1].data.issue.?.description, first_issue.description); │ │153 │ │154 // the tags were correctly edited │ │156 - try std.testing.expectEqualStrings(events_to_consume[1].data.issue.?.tags, first_issue.issue.tags); │ │155 + try std.testing.expectEqualStrings(events_to_consume[1].data.issue.?.tags, first_issue.tags); │ │156 } │ │157 │ │158 // │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │161 │ │162 const events_to_consume2 = [_]evt.Event{ │ │163 .{ │ │165 - .id = std.fmt.bytesToHex(evt.randomId(prng.random()), .lower), │ │164 + .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower),│ │165 .data = .{ │ │166 .issue = .{ │ │167 .title = "Double clicking causes the form to submit twice", │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │282 // get the issue out of the map that was edited │ │283 const first_issue_cursor = try event_id_to_issue.getCursor(hash.hashInt(repo_opts.hash, &first_event_id)) orelse return error.NotFound;│ │284 const first_issue_map = try Repo.DB.HashMap(.read_only).init(first_issue_cursor); │ │286 - const first_issue = try evt.EventData.read(Repo.DB, repo_opts.hash, arena.allocator(), first_issue_map, .issue); │ │285 + const first_issue = try evt.Issue.read(Repo.DB, repo_opts.hash, &arena, first_issue_map); │ │286 │ │287 // the description is no longer edited │ │289 - try std.testing.expectEqualStrings(events_to_consume[0].data.issue.?.description, first_issue.issue.description); │ │288 + try std.testing.expectEqualStrings(events_to_consume[0].data.issue.?.description, first_issue.description); │ │289 │ │290 // the tags are no longer edited │ │292 - try std.testing.expectEqualStrings(events_to_consume[0].data.issue.?.tags, first_issue.issue.tags); │ │291 + try std.testing.expectEqualStrings(events_to_consume[0].data.issue.?.tags, first_issue.tags); │ │292 │ │293 // an event added by the second push is no longer there because it was wiped out by the rebase │ │294 try std.testing.expect(null == try event_id_to_issue.getCursor(hash.hashInt(repo_opts.hash, &events_to_consume2[0].id))); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │401 │ │402 const events_to_consume = [_]evt.Event{ │ │403 .{ │ │405 - .id = std.fmt.bytesToHex(evt.randomId(prng.random()), .lower), │ │404 + .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower),│ │405 .data = .{ │ │406 .issue = .{ │ │407 .title = "Login form clears password on validation error", │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │411 }, │ │412 }, │ │413 .{ │ │415 - .id = std.fmt.bytesToHex(evt.randomId(prng.random()), .lower), │ │414 + .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower),│ │415 .data = .{ │ │416 .issue = .{ │ │417 .title = "Search results ignore archived project filter", │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │421 }, │ │422 }, │ │423 .{ │ │425 - .id = std.fmt.bytesToHex(evt.randomId(prng.random()), .lower), │ │424 + .id = std.fmt.bytesToHex(evt.Event.randomId(prng.random()), .lower),│ │425 .data = .{ │ │426 .issue = .{ │ │427 .title = "Issue list does not persist selected sort order", │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯