Skip to content

Commit

Permalink
Fixing tests for jiffy null support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Kirilenko committed May 29, 2014
1 parent dafa19d commit c8a0b44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/msgpack.erl
Expand Up @@ -166,15 +166,15 @@ parse_options([{ext, {Packer,Unpacker}}|TL], Opt0) when
-include_lib("eunit/include/eunit.hrl").

test_data()->
[true, false, nil,
[true, false, null,
0, 1, 2, 123, 512, 1230, 678908, 16#FFFFFFFFFF,
-1, -23, -512, -1230, -567898, -16#FFFFFFFFFF,
-16#80000001,
123.123, -234.4355, 1.0e-34, 1.0e64,
[23, 234, 0.23],
<<"hogehoge">>, <<"243546rf7g68h798j", 0, 23, 255>>,
<<"hoasfdafdas][">>,
[0,42, <<"sum">>, [1,2]], [1,42, nil, [3]],
[0,42, <<"sum">>, [1,2]], [1,42, null, [3]],
-234, -40000, -16#10000000, -16#100000000,
42
].
Expand Down
20 changes: 10 additions & 10 deletions test/msgpack_test.erl
Expand Up @@ -146,22 +146,22 @@ issue_jiffy_5_test() ->

issue_27_test_() ->
[
%% nil(jiffy) => nil(msgpack) => null(jsx)
%% null(jiffy) => nil(msgpack) => null(jsx)
?_assertEqual({ok, null},
msgpack:unpack(msgpack:pack(nil), [{format,jsx}])),
msgpack:unpack(msgpack:pack(null), [{format,jsx}])),

%% nil(jiffy) => nil(msgpack) => nil(jiffy)
?_assertEqual({ok, nil},
msgpack:unpack(msgpack:pack(nil, [{format,jiffy}]))),
%% null(jiffy) => nil(msgpack) => null(jiffy)
?_assertEqual({ok, null},
msgpack:unpack(msgpack:pack(null, [{format,jiffy}]))),


%% null(jsx) => nil(msgpack) => nil(jiffy)
?_assertEqual({ok, nil},
%% null(jsx) => nil(msgpack) => null(jiffy)
?_assertEqual({ok, null},
msgpack:unpack(msgpack:pack(null, [{format,jsx}]))),

%% null(jiffy-atom) => <<null>>(msgpack-binary) => <<"nil">>
?_assertEqual({ok, <<"null">>},
msgpack:unpack(msgpack:pack(null, [{allow_atom,pack}]))),
%% nil(jiffy-atom) => <<nil>>(msgpack-binary) => <<"nil">>
?_assertEqual({ok, <<"nil">>},
msgpack:unpack(msgpack:pack(nil, [{allow_atom,pack}]))),

%% nil(jsx-atom) => <<nil>>(msgpack-binary) => <<"nil">>
?_assertEqual({ok, <<"nil">>},
Expand Down

0 comments on commit c8a0b44

Please sign in to comment.