Skip to content

Commit

Permalink
Add test for index marshalling.
Browse files Browse the repository at this point in the history
  • Loading branch information
seancribbs committed Jul 13, 2012
1 parent 18c5ae1 commit 090396d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/encoding_test.erl
Expand Up @@ -48,6 +48,19 @@ pb_test_() ->
?assertEqual(true, MdSame1),
?assertEqual(true, MdSame2)
end)},
{"indexes encode decode",
?_test(begin
InputMD = dict:from_list([{?MD_INDEX, [{"index_bin", "foo"},
{"index_int", 10}]}]),
ExpectedMD = [{?MD_INDEX, [{<<"index_bin">>, <<"foo">>},
{<<"index_int">>, <<"10">>}]}],
Value = <<"test value">>,
{OutputMD, _} = riak_pb_kv_codec:decode_content(
riak_kv_pb:decode_rpbcontent(
riak_kv_pb:encode_rpbcontent(
riak_pb_kv_codec:encode_content({InputMD, Value})))),
?assertEqual(ExpectedMD, dict:to_list(OutputMD))
end)},
{"empty content encode decode",
?_test(begin
MetaData = dict:new(),
Expand Down

0 comments on commit 090396d

Please sign in to comment.