MCPcopy
hub / github.com/yjs/yjs / testRepeatRandomDiffing

Function testRepeatRandomDiffing

tests/IdMap.tests.js:112–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 * @param {t.TestCase} tc
111 */
112export const testRepeatRandomDiffing = tc => {
113 const clients = 4
114 const clockRange = 100
115 const attrs = [1, 2, 3]
116 const idset1 = createRandomIdMap(tc.prng, clients, clockRange, attrs)
117 const idset2 = createRandomIdMap(tc.prng, clients, clockRange, attrs)
118 const merged = idmap.mergeIdMaps([idset1, idset2])
119 const e1 = idmap.diffIdMap(idset1, idset2)
120 const e2 = idmap.diffIdMap(merged, idset2)
121 compareIdMaps(e1, e2)
122 const copy = YY.decodeIdMap(YY.encodeIdMap(e1))
123 compareIdMaps(e1, copy)
124}
125
126/**
127 * @param {t.TestCase} tc

Callers

nothing calls this directly

Calls 1

createRandomIdMapFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…