mirror of
https://github.com/valitydev/msgpack-erlang.git
synced 2024-11-06 08:45:19 +00:00
Use unpack_map_jiffy by default
This commit is contained in:
parent
125a9e13ee
commit
2f460f4a01
@ -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
|
||||
|
@ -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_() ->
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user