Skip to content

Commit

Permalink
proper_report: fix bug when printing out state/results failed because…
Browse files Browse the repository at this point in the history
… the number of executed commands didn't match the plan
  • Loading branch information
Yurii Rashkovskii committed Sep 16, 2011
1 parent 0561981 commit 40858ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/proper_report.erl
Expand Up @@ -38,6 +38,10 @@ report(Cmds, History, FinalState, Result, Fun) ->
Sequence = [ translate(VarsPLst, Cmd) || Cmd <- Cmds],
Fun("~n---Command sequence:~n~s~n", [string:join(Sequence,"\n")]),
Fun("~n---States and results:~n", []),
AdjustedSequence = lists:reverse(
lists:nthtail(length(Sequence) + 1 -
length(FullHistory),
lists:reverse(["init"|Sequence]))),
[Fun("Command:~n~s~n"
"Result:~n~s~n"
"State was:~n~s~n"
Expand All @@ -47,7 +51,8 @@ report(Cmds, History, FinalState, Result, Fun) ->
io_lib_pretty:print(Res, 1, 80, -1),
io_lib_pretty:print(State, 1, 80, -1)
])
|| {{Res, State}, Command} <- lists:zip(FullHistory, ["none"|Sequence]) ].
|| {{Res, State}, Command} <- lists:zip(FullHistory,
AdjustedSequence) ].

find_reused(Cmds) ->
find_reused(Cmds, []).
Expand Down

0 comments on commit 40858ad

Please sign in to comment.