Permalink
Browse files

erlang: fixed bug around error case when serializing atom.

  • Loading branch information...
1 parent dcbcf58 commit c42cba1d5453f718a85f49f7441387ed4d0a7210 UENISHI Kota committed Aug 27, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 erlang/msgpack.erl
View
@@ -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.

0 comments on commit c42cba1

Please sign in to comment.