diff --git a/tests/persona-matrix-mouth.test.mjs b/tests/persona-matrix-mouth.test.mjs index f76a851..7cb52a5 100644 --- a/tests/persona-matrix-mouth.test.mjs +++ b/tests/persona-matrix-mouth.test.mjs @@ -1660,3 +1660,9 @@ test("tail gaps: the builder refuses a repeated room, and a pre-gap decoder is s assert.throws(() => docs.parsePendingV3(["eureka", [], []]), /4-field/); assert.throws(() => docs.parsePendingV3(["eureka", [], [], "#a:x"]), /list/); }); + +test("tail gaps: a line the mouth drops as malformed (no event id) gaps its room; a clean room beside it does not", async () => { + const { tail, gaps } = await tailed({ preload: { [ROOM]: [message("", META, "no id", 10), message("$ok", META, "fine", 11)], [OPERATOR]: lines(OPERATOR, 1) } }); + assert.deepEqual(tail.map(l => l.eventId).sort(), ["$ok", "$ope0"].sort()); + assert.deepEqual(gaps, [SWARM_ALIAS]); +});