Provide a mock version of RunData to produce a configurable sequence of "rolls" for use in testing
selquest opened this issue · 1 comments
selquest commented
When adding new dice expression syntax, testing would be made much easier if a specific sequence of "rolls" could be constructed to exercise various behaviors.
This would be especially helpful in testing various "keep" or "choose" or "reroll" behaviors - the current testing model relies on a fixed seed for the random number generator, but it takes a good bit of experimentation to find a combination of rolls that effectively tests the behavior.
The presence of the static ThreadLocal current
in RunData provides an opportunity to inject the Mock implementation for use during testing.