tracker
All repositories: gitoria
1.8 KB
// tracker#62: native lookups preserve map winners and creation conflict suffixes.import { personsTable, showsTable } from '../lib/shows.hl'import { personBySlug, personIdByTmdb, castPersonId, guestPersonId } from '../lib/people.hl'static check = (Boolean ok, String message) => { if (!ok) { hlError(message) } }static run = () => {for (p of [{ id = 'index-first' oldId = 'index-first' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }{ id = 'index-last' oldId = 'index-last' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }{ id = 'index-suffix' oldId = 'index-suffix' name = 'Same Name' urlSegment = 'Same-Name-2' tmdbId = 87650002 }]) { check(personsTable.put(p) != null, 'seed') }check(personBySlug('Same-Name').id == 'index-last', 'last slug winner')check(personIdByTmdb(87650001) == 'index-last', 'last TMDB winner')check(personIdByTmdb('87650001') == 'index-last', 'TMDB string coercion')check(personBySlug('missing') == null && personBySlug('') == null && personBySlug(null) == null, 'absent slug')check(personIdByTmdb(87659999) == null, 'absent TMDB')c = { tmdbId = 87650003 name = 'Same Name' character = 'Role' }id = castPersonId(&c, null)check(id != null && personBySlug('Same-Name-3').id == id, 'conflict suffix')check(castPersonId(&c, null) == id, 'repeat cast import')check(guestPersonId(87650003, null).created == false, 'known guest')s = { id = 'index-show' oldId = 'index-show' cast = [{ tmdbId = 87650004 actor = 'Same Name' character = 'Guest' }] }check(showsTable.put(s) != null, 'guest show')g = guestPersonId(87650004, 'index-show')check(g.created && personBySlug('Same-Name-4').id == g.id, 'new guest')check(guestPersonId(87650004, 'index-show').created == false, 'guest revisit')check(personIdByTmdb(87650004) == g.id, 'new guest TMDB lookup')personsTable.persist()console.log('person-index: passed')return true}run()
Branches
Latest commits
- 613ae0ecMerge branch 'bs3' into mainTracker
- 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
- 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
- 310613f1Merge branch 'records-dp72' into mainTracker
- 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
- c41587d2Merge branch 'bs2' into mainTracker
- 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
- 019d5cedMerge branch 'records-1110' into mainTracker
- f88ae8b9|||PR records: day56 toggle live, reviewTracker
- b6b3bb4dMerge branch 'ap56e' into mainTracker
- 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker
- 7c9ec236|||PR AP56e: re-vendor Hybriel set day56 (source 36ae83a8, bin c1f595a2)Tracker
- 4b54f6f9Merge branch 'records-audit' into mainTracker
- cab4a3bc|||PR records: branch audit, PR-onlyTracker
- 641e1c4cMerge branch 'records-dp71' into mainTracker
- 85a6e9f5|||PR records: DP71 checked in ChromeTracker
- f5be5f18records: gitoria PR-only planTracker
- 46a37036records: DP71 liveTracker
- 3bcb7039Status/log: DP71 in progressTracker
- 5b3a5693Log: SR1b merged via PR 2, DP71 startedTracker