diff --git a/erlang/msgpack.erl b/erlang/msgpack.erl index b54874d5..8c85458e 100644 --- a/erlang/msgpack.erl +++ b/erlang/msgpack.erl @@ -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.