Skip to content

Commit

Permalink
Broken proptests
Browse files Browse the repository at this point in the history
  • Loading branch information
v0idpwn committed May 30, 2022
1 parent e2c0646 commit 29bb039
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
9 changes: 1 addition & 8 deletions apps/antidote_crdt/test/prop_map_go.erl
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,9 @@ op() -> ?SIZED(Size, op(Size)).
op(Size) ->
{update, oneof([
nestedOp(Size),
?LET(L, list(nestedOp(Size div 2)), removeDuplicateKeys(L, []))
?LET(L, list(nestedOp(Size div 2)), L)
])}.

removeDuplicateKeys([], _) -> [];
removeDuplicateKeys([{Key, Op}|Rest], Keys) ->
case lists:member(Key, Keys) of
true -> removeDuplicateKeys(Rest, Keys);
false -> [{Key, Op}|removeDuplicateKeys(Rest, [Key|Keys])]
end.

nestedOp(Size) ->
oneof(
[
Expand Down
20 changes: 3 additions & 17 deletions apps/antidote_crdt/test/prop_map_rr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,17 @@ op() -> ?SIZED(Size, op(Size)).
op(Size) ->
oneof([
{update, nestedOp(Size)},
{update, ?LET(L, list(nestedOp(Size div 2)), removeDuplicateKeys(L, []))},
{update, ?LET(L, list(nestedOp(Size div 2)), L)},
{remove, typed_key()},
{remove, ?LET(L, list(typed_key()), lists:usort(L))},
{remove, ?LET(L, list(typed_key()), L)},
?LET({Updates, Removes},
{list(nestedOp(Size div 2)), list(typed_key())},
begin
Removes2 = lists:usort(Removes),
Updates2 = removeDuplicateKeys(Updates, Removes2),
{batch, {Updates2, Removes2}}
{batch, {Updates, Removes}}
end),
{reset, {}}
]).

removeDuplicateKeys([], _) -> [];
removeDuplicateKeys([{Key, Op}|Rest], Keys) ->
case lists:member(Key, Keys) of
true -> removeDuplicateKeys(Rest, Keys);
false -> [{Key, Op}|removeDuplicateKeys(Rest, [Key|Keys])]
end.

nestedOp(Size) ->
oneof(
[
Expand All @@ -141,8 +132,3 @@ crdt_type() ->

key() ->
oneof([key1, key2, key3, key4]).





0 comments on commit 29bb039

Please sign in to comment.