This commit is contained in:
Raven Scott
2026-05-20 20:19:20 -04:00
parent 040f1d05ea
commit d70060ec4e
365 changed files with 23547 additions and 431 deletions
+19
View File
@@ -25,3 +25,22 @@ test('hyper-p2p-conflict-set: close without leak', async (t) => {
await m.close()
t.pass()
})
test('hyper-p2p-conflict-set: validation rejects invalid input', async (t) => {
const m = new HyperP2PConflictSet()
try {
if (typeof m.addNeighbor === 'function') m.addNeighbor(null)
else if (typeof m.buildCircuit === 'function') m.buildCircuit([])
else if (typeof m.grant === 'function') m.grant(null, -1)
else if (typeof m.enqueue === 'function') m.enqueue('bad', null)
else if (typeof m.reportSample === 'function') m.reportSample(null, -1, -1)
else if (typeof m.fanout === 'function') m.fanout(null, 0)
else if (typeof m.probe === 'function') m.probe(null)
else if (typeof m.resolve === 'function') m.resolve(null)
else if (typeof m.acquire === 'function') m.acquire(null)
else throw new Error('no validation hook')
t.fail('expected throw')
} catch (err) {
t.ok(err instanceof Error)
}
await m.close()
})