chewbranca commented on code in PR #4483:
URL: https://github.com/apache/couchdb/pull/4483#discussion_r1185500224
##########
src/couch_log/test/eunit/couch_log_formatter_test.erl:
##########
@@ -25,6 +25,22 @@ truncate_test() ->
Entry = couch_log_formatter:format(info, self(), Msg),
?assert(length(Entry#log_entry.msg) =< 16000).
+format_report_etoolong_test() ->
+ Payload = lists:flatten(["a" || _ <- lists:seq(1, 1048576)]),
+ Resp = couch_log_formatter:format_report(self(), report123, #{
+ msg => Payload
+ }),
+ ?assertEqual({error, emsgtoolong}, Resp).
+
+format_report_test() ->
+ {ok, Entry} = couch_log_formatter:format_report(self(), report123, #{
+ foo => 123,
+ bar => "barStr",
+ baz => baz
+ }),
+ Formatted = "[foo=\"123\" baz=\"baz\" bar=\"barStr\"]",
Review Comment:
Thanks for the feedback. I agree the generic test version is quite a bit
more complex and I'm not a huge fan. For now I've added a comment at the test
location.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]