Error thrown when a mock RNG runs out of predefined values.
This is intentional behavior, not a limitation: a mock that wrapped around
would silently pass a test whose expression rolls more dice than the author
thought. Seeing this error means the notation consumed more draws than the
sequence supplied — count the dice, including explosions, rerolls, and
meta-expressions, and check the draw order in the roll-parser README.
Deliberately outside the RollParserError hierarchy — no code, and
isRollParserError answers false for it. An exhausted mock is a bug in the
test fixture, not a failure mode of the notation, so the
if (!isRollParserError(error)) throw error line a consumer writes around
roll() rethrows it and fails the test instead of routing it to a "bad dice"
message. instanceof is the check here — there is no code to branch on.
How many values the sequence handed out before running dry — equivalently,
the length of the array that was passed to createMockRng. Compare it
against the dice you expected to be rolled to find the miscount.
Error thrown when a mock RNG runs out of predefined values.
This is intentional behavior, not a limitation: a mock that wrapped around would silently pass a test whose expression rolls more dice than the author thought. Seeing this error means the notation consumed more draws than the sequence supplied — count the dice, including explosions, rerolls, and meta-expressions, and check the draw order in the roll-parser README.
Deliberately outside the
RollParserErrorhierarchy — nocode, andisRollParserErroranswersfalsefor it. An exhausted mock is a bug in the test fixture, not a failure mode of the notation, so theif (!isRollParserError(error)) throw errorline a consumer writes aroundroll()rethrows it and fails the test instead of routing it to a "bad dice" message.instanceofis the check here — there is nocodeto branch on.Example