gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitcb78a1a0cb78a1a0HM65 report missing heap diagnostic package with repromrecb78a1a0/tests/hm56-list-order.hl

1.1 KB

  1. // The helpers must change the caller's list and keep the old tie order, without returning a rebuilt list.
  2. import { insertByFollowDesc } from '../lib/follows.hl'
  3. import { insertByReleaseAsc } from '../components/schedule.hl'
  4. oldInsert = (&sorted, &row, &release) => {
  5. out = []
  6. let inserted = false
  7. for (x of sorted) {
  8. if (!inserted && (release ? row.release <= x.release : row.followedAt >= x.followedAt)) {
  9. out.push(row)
  10. inserted = true
  11. }
  12. out.push(x)
  13. }
  14. if (!inserted) { out.push(row) }
  15. return out
  16. }
  17. verify = () => {
  18. for (release of [false, true]) {
  19. actual = []
  20. let expected = []
  21. let i = 0
  22. for (value of [0, 9, 2, 9, 1, 0, 12, 2]) {
  23. row = { id = '' + i followedAt = value release = '2026-11-' + (value < 10 ? '0' : '') + value }
  24. expected = oldInsert(&expected, &row, &release)
  25. if (release) { insertByReleaseAsc(&actual, &row) }
  26. else { insertByFollowDesc(&actual, &row) }
  27. if (JSON.stringify(actual) != JSON.stringify(expected)) { hlError('order or caller mutation differs after insertion ' + i + ', release=' + release) }
  28. i = i + 1
  29. }
  30. }
  31. console.log('16 insertions match historical order, including ties; caller mutation verified')
  32. }
  33. verify()

Branches

Latest commits

  • cb78a1a0HM65 report missing heap diagnostic package with repromre
  • 89606a5cHM65 briefmre
  • 096ce0d4log: DP69 live on day48mre
  • b3d8a80bDP69 brief, RV48 mergedmre
  • ce6d7d32Merge rv48: Hybriel day48mre
  • 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
  • 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
  • 4a802ae7status: RV48 runningmre
  • 0a5412b6RV48 brief, day48 outmre
  • 56665efelog: CB69 mergedmre
  • 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
  • e55b379dKeep shared app title independent of the route import graphmre
  • 9a99659blog: hybriel#334, batch waits for day48mre
  • 85fa6c9blog: CB68 result, CB69 startedmre
  • 2f07c1b7log: DP68 boot gate failed, CB68mre
  • 9652782dlog: HM59 merged, DP68 startedmre
  • 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
  • f7bfe90bMove remaining page builders into their topicsmre
  • 7c3991f9log: day46 from Antonmre
  • ec54fc35Move show page logic into the shows topicmre