Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
add map to supported crdts
Browse files Browse the repository at this point in the history
  • Loading branch information
deepthidevaki committed Jun 30, 2016
1 parent 58f046f commit a7021de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/antidote_crdt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
antidote_crdt_gset,
antidote_crdt_rga,
antidote_crdt_bcounter,
antidote_crdt_mvreg
antidote_crdt_mvreg,
antidote_crdt_map
]).

-export([is_type/1
Expand Down
8 changes: 7 additions & 1 deletion src/antidote_crdt_map.erl
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,18 @@ to_binary(CRDT) ->
from_binary(Bin) ->
?RIAK_MODULE:from_binary(Bin).

-ifdef(test).
-ifdef(TEST).
all_test() ->
S0 = new(),
Field = {'C', riak_dt_pncounter},
{ok, Downstream} = downstream({update, {[{update, Field, {increment, 1}}], actor}}, S0),
{ok, S1} = update(Downstream, S0),
?assertEqual([{Field, 1}], value(S1)).

type_check_test() ->
Res = is_operation({update,{[{update,{key,riak_dt_lwwreg},{assign,<<"A">>}},
{update,{val,riak_dt_pncounter},{increment,1}}],
hardcodedactor}}),
?assertEqual(true, Res).

-endif.

0 comments on commit a7021de

Please sign in to comment.