MCPcopy
hub / github.com/yjs/yjs / testRepeatRandomIntersects

Function testRepeatRandomIntersects

tests/IdSet.tests.js:228–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226 * @param {t.TestCase} tc
227 */
228export const testRepeatRandomIntersects = tc => {
229 const clients = 4
230 const clockRange = 100
231 const ids1 = createRandomIdSet(tc.prng, clients, clockRange)
232 const ids2 = createRandomIdSet(tc.prng, clients, clockRange)
233 const intersected = d.intersectSets(ids1, ids2)
234 for (let client = 0; client < clients; client++) {
235 for (let clock = 0; clock < clockRange; clock++) {
236 t.assert((ids1.has(client, clock) && ids2.has(client, clock)) === intersected.has(client, clock))
237 }
238 }
239 const diffed1 = d.diffIdSet(ids1, ids2)
240 const altDiffed1 = d.diffIdSet(ids1, intersected)
241 compareIdSets(diffed1, altDiffed1)
242}

Callers

nothing calls this directly

Calls 3

createRandomIdSetFunction · 0.90
compareIdSetsFunction · 0.90
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…