summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2018-12-21 14:24:56 +0300
committerGitHub <noreply@github.com>2018-12-21 14:24:56 +0300
commit7e347885de96e95ce85fab577861b98aa0fa7dbf (patch)
tree4582665f80f20ae6881126d8f301b1993ca2e77a /test
parent794ef8de24ec261d1f3217f0a1ccfae98c8c6873 (diff)
parentb20ad12d7b2f9769493fbbbb35eb672b0bd75343 (diff)
downloadrabbitmq-server-git-7e347885de96e95ce85fab577861b98aa0fa7dbf.tar.gz
Merge pull request #1808 from rabbitmq/ra_machine_apply_3
rabbit_fifo: apply/4 -> apply/3
Diffstat (limited to 'test')
-rw-r--r--test/rabbit_fifo_prop_SUITE.erl22
1 files changed, 17 insertions, 5 deletions
diff --git a/test/rabbit_fifo_prop_SUITE.erl b/test/rabbit_fifo_prop_SUITE.erl
index 1c1ab42a9e..1af0d3b4b0 100644
--- a/test/rabbit_fifo_prop_SUITE.erl
+++ b/test/rabbit_fifo_prop_SUITE.erl
@@ -278,8 +278,16 @@ handle_op(purge, T) ->
do_apply(Cmd, #t{effects = Effs, index = Index, state = S0,
log = Log} = T) ->
- {S, Effects, _} = rabbit_fifo:apply(#{index => Index}, Cmd, [], S0),
- T#t{state = S,
+ {St, Effects} = case rabbit_fifo:apply(#{index => Index}, Cmd, S0) of
+ {S, _, E} when is_list(E) ->
+ {S, E};
+ {S, _, E} ->
+ {S, [E]};
+ {S, _} ->
+ {S, []}
+ end,
+
+ T#t{state = St,
index = Index + 1,
effects = enq_effs(Effects, Effs),
log = [Cmd | Log]}.
@@ -338,9 +346,13 @@ prefixes(Source, N, Acc) ->
run_log(InitState, Entries) ->
lists:foldl(fun ({Idx, E}, {Acc0, Efx0}) ->
- case rabbit_fifo:apply(meta(Idx), E, Efx0, Acc0) of
- {Acc, Efx, _} ->
- {Acc, Efx}
+ case rabbit_fifo:apply(meta(Idx), E, Acc0) of
+ {Acc, _, Efx} when is_list(Efx) ->
+ {Acc, Efx0 ++ Efx};
+ {Acc, _, Efx} ->
+ {Acc, Efx0 ++ [Efx]};
+ {Acc, _} ->
+ {Acc, Efx0}
end
end, {InitState, []}, Entries).