mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-18 12:34:15 +01:00
erlang: fixed bug around error case when serializing atom.
This commit is contained in:
parent
dcbcf5842f
commit
c42cba1d54
@ -126,7 +126,7 @@ pack_(List) when is_list(List) ->
|
||||
pack_({Map}) when is_list(Map) ->
|
||||
pack_map(Map);
|
||||
pack_(Other) ->
|
||||
throw({error, {badarg, Other}}).
|
||||
throw({badarg, Other}).
|
||||
|
||||
|
||||
-spec pack_uint_(non_neg_integer()) -> binary().
|
||||
@ -387,4 +387,9 @@ benchmark_test()->
|
||||
{Data,<<>>}=?debugTime("deserialize", msgpack:unpack(S)),
|
||||
?debugFmt("for ~p KB test data.", [byte_size(S) div 1024]).
|
||||
|
||||
error_test()->
|
||||
?assertEqual({error,{badarg, atom}}, msgpack:pack(atom)),
|
||||
Term = {"hoge", "hage", atom},
|
||||
?assertEqual({error,{badarg, Term}}, msgpack:pack(Term)).
|
||||
|
||||
-endif.
|
||||
|
Loading…
x
Reference in New Issue
Block a user