From 8ef7c069e3880cb944a8125ff2c855cf0bc48ac7 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:45:15 +0100 Subject: optionally assert state --- rtt-module.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'rtt-module.js') diff --git a/rtt-module.js b/rtt-module.js index 6c35fd2..bd8a1ae 100755 --- a/rtt-module.js +++ b/rtt-module.js @@ -149,6 +149,16 @@ module.exports.fuzz = function(fuzzerInputData) { throw new UndoSeedError(`undo caused seed change from ${seed} to ${state.seed}`) } } + + if (RULES.assertState) { + try { + RULES.assertState(state) + } catch (e) { + log_crash(replay, state, view, step, active, action, args) + throw new RulesCrashError(e, e.stack) + } + } + step += 1 } } -- cgit v1.2.3