|
|
@@ -206,7 +206,9 @@ t_to_map(_) ->
|
|
|
{headers, #{}},
|
|
|
{topic, <<"topic">>},
|
|
|
{payload, <<"payload">>},
|
|
|
- {timestamp, emqx_message:timestamp(Msg)}],
|
|
|
+ {timestamp, emqx_message:timestamp(Msg)},
|
|
|
+ {extra, []}
|
|
|
+ ],
|
|
|
?assertEqual(List, emqx_message:to_list(Msg)),
|
|
|
?assertEqual(maps:from_list(List), emqx_message:to_map(Msg)).
|
|
|
|
|
|
@@ -219,6 +221,8 @@ t_from_map(_) ->
|
|
|
headers => #{},
|
|
|
topic => <<"topic">>,
|
|
|
payload => <<"payload">>,
|
|
|
- timestamp => emqx_message:timestamp(Msg)},
|
|
|
+ timestamp => emqx_message:timestamp(Msg),
|
|
|
+ extra => []
|
|
|
+ },
|
|
|
?assertEqual(Map, emqx_message:to_map(Msg)),
|
|
|
?assertEqual(Msg, emqx_message:from_map(emqx_message:to_map(Msg))).
|