Use unpack_map_jiffy by default

This commit is contained in:
Yuki Ito 2014-04-15 04:55:37 +09:00
parent 125a9e13ee
commit 2f460f4a01
2 changed files with 15 additions and 2 deletions

View File

@ -82,7 +82,7 @@
-else.
-record(options_v3, {
interface = jiffy :: format_type(),
map_unpack_fun = fun msgpack_unpacker:unpack_map/3 ::
map_unpack_fun = fun msgpack_unpacker:unpack_map_jiffy/3 ::
msgpack_map_unpacker(),
impl = erlang :: erlang | nif,
allow_atom = none :: none | pack, %% allows atom when packing

View File

@ -176,7 +176,20 @@ string_test() ->
MsgpackStringBin = msgpack:pack(String),
{ok, String} = msgpack:unpack(MsgpackStringBin).
default_test_() ->
[
{"pack",
fun() ->
Map = {[{1,2}]},
?assertEqual(pack(Map, [{format, jiffy}]), pack(Map))
end},
{"unpack",
fun() ->
Map = {[{1,2}]},
Binary = pack(Map, [{format, jiffy}]),
?assertEqual(unpack(Binary, [{format, jiffy}]), unpack(Binary))
end}
].
unpack_test_() ->
[