diff --git a/tests/reference-day-care.spec.ts b/tests/reference-day-care.spec.ts index 8ddfa17..8bfd886 100644 --- a/tests/reference-day-care.spec.ts +++ b/tests/reference-day-care.spec.ts @@ -190,8 +190,15 @@ test.describe("Day-Care routines against the cartridge", () => { ...extra, }); - // A small deterministic generator for the cases. - let seed = 0x5eed; + // A small deterministic generator for the cases, seeded by each test from + // its own title (FNV-1a): a test's cases are the same whichever tests ran + // before it in the worker, and in every browser. + let seed = 0; + test.beforeEach(({}, testInfo) => { + seed = 0x811c9dc5; + for (const character of testInfo.title) + seed = Math.imul(seed ^ character.charCodeAt(0), 0x01000193) >>> 0; + }); const next = (limit = 256) => { seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0; return (seed >>> 8) % limit;