Skip to content

Commit 70bc223

Browse files
committed
it was wrong to change the default; back to old conservative default
1 parent d1d9934 commit 70bc223

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

include/msgpack.hrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181

8282
-else.
8383
-record(options_v3, {
84-
interface = map :: format_type(),
84+
interface = jiffy :: format_type(),
8585
map_unpack_fun = fun msgpack_unpacker:unpack_map/3 ::
8686
msgpack_map_unpacker(),
8787
impl = erlang :: erlang | nif,

test/msgpack_test.erl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,25 @@ issue_jiffy_5_test() ->
145145

146146

147147
issue_27_test_() ->
148-
[?_assertEqual({ok, null},
148+
[
149+
%% nil(jiffy) => nil(msgpack) => null(jsx)
150+
?_assertEqual({ok, null},
149151
msgpack:unpack(msgpack:pack(nil), [{format,jsx}])),
152+
153+
%% nil(jiffy) => nil(msgpack) => nil(jiffy)
150154
?_assertEqual({ok, nil},
151155
msgpack:unpack(msgpack:pack(nil, [{format,jiffy}]))),
156+
157+
158+
%% null(jsx) => nil(msgpack) => nil(jiffy)
159+
?_assertEqual({ok, nil},
160+
msgpack:unpack(msgpack:pack(null, [{format,jsx}]))),
161+
162+
%% null(jiffy-atom) => <<null>>(msgpack-binary) => <<"nil">>
152163
?_assertEqual({ok, <<"null">>},
153164
msgpack:unpack(msgpack:pack(null, [{allow_atom,pack}]))),
165+
166+
%% nil(jsx-atom) => <<nil>>(msgpack-binary) => <<"nil">>
154167
?_assertEqual({ok, <<"nil">>},
155168
msgpack:unpack(msgpack:pack(nil,
156169
[{format,jsx},{allow_atom,pack}])))].

0 commit comments

Comments
 (0)