1. Justin Sheehy
  2. riak

Commits

Bryan Fink  committed b5ac31c

test riak_object:get_update_value and _metadata

  • Participants
  • Parent commits 870603d
  • Branches default

Comments (0)

Files changed (1)

File src/riak_object.erl

View file
     O5 = riak_object:reconcile([O2,O4], false),
     false = riak_object:equal(O2, O5),
     false = riak_object:equal(O4, O5).
+
+get_update_value_test() ->
+    O = riak_object:new(test, <<"test">>, old_val),
+    NewVal = new_val,
+    ?assertEqual(NewVal,
+                 riak_object:get_update_value(
+                   riak_object:update_value(O, NewVal))).
+
+get_update_metadata_test() ->
+    O = riak_object:new(test, <<"test">>, val),
+    OldMD = riak_object:get_metadata(O),
+    NewMD = dict:store(<<"X-Riak-Test">>, "testval", OldMD),
+    ?assertNot(NewMD =:= OldMD),
+    ?assertEqual(NewMD,
+                 riak_object:get_update_metadata(
+                   riak_object:update_metadata(O, NewMD))).