Skip to content

Commit f9a1f9e

Browse files
Add failing test
1 parent 4081a5f commit f9a1f9e

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

test/prop_causal_context.erl

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,23 @@ prop_union() ->
126126
).
127127

128128
%% @private
129-
ds(L) ->
130-
dot_set:from_dots(L).
129+
cc(L) ->
130+
lists:foldl(
131+
fun(Dot, CC) ->
132+
causal_context:add_dot(Dot, CC)
133+
end,
134+
causal_context:new(),
135+
shuffle(L)
136+
).
131137

132138
%% @private
133-
cc(L) ->
134-
causal_context:from_dot_set(ds(L)).
139+
shuffle(L) ->
140+
rand:seed(exsplus, erlang:timestamp()),
141+
lists:map(
142+
fun({_, E}) -> E end,
143+
lists:sort(
144+
lists:map(
145+
fun(E) -> {rand:uniform(), E} end, L
146+
)
147+
)
148+
).

0 commit comments

Comments
 (0)