summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrtt-module.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/rtt-module.js b/rtt-module.js
index c0bc30f..5fe60ba 100755
--- a/rtt-module.js
+++ b/rtt-module.js
@@ -118,6 +118,7 @@ module.exports.fuzz = function(fuzzerInputData) {
let action = data.pickValue(Object.keys(actions))
let args = actions[action]
+ let seed = state.seed
if (args !== undefined && args !== null && typeof args !== "number" && typeof args !== "boolean") {
// check for NaN as any suggested action argument and raise an error on those
@@ -138,9 +139,15 @@ module.exports.fuzz = function(fuzzerInputData) {
throw new RulesCrashError(e, e.stack)
}
- if (action === "undo" && state.active !== active) {
- log_crash(replay, state, view, step, active)
- throw new UndoActiveError(`undo caused active to switch from ${active} to ${state.active}`)
+ if (action === "undo") {
+ if (state.active !== active) {
+ log_crash(replay, state, view, step, active)
+ throw new UndoActiveError(`undo caused active to switch from ${active} to ${state.active}`)
+ }
+ if (state.seed !== seed) {
+ log_crash(replay, state, view, step, active)
+ throw new UndoSeedError(`undo caused seed change from ${seed} to ${state.seed}`)
+ }
}
step += 1
}
@@ -198,6 +205,13 @@ class UndoActiveError extends Error {
}
}
+class UndoSeedError extends Error {
+ constructor(message) {
+ super(message)
+ this.name = "UndoSeedError"
+ }
+}
+
class RulesCrashError extends Error {
constructor(message, stack) {
super(message)