diff options
author | Siri Hansen <[email protected]> | 2018-05-18 14:49:42 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2018-05-23 11:11:13 +0200 |
commit | 4a055a655e1f82639b261689e56cbf2f1dc2d5c3 (patch) | |
tree | 96c14ebfdba8d8703dd8936e2f8f8318ed89c79f /lib/kernel/test/logger_formatter_SUITE.erl | |
parent | cfbe1afe6ba1f1083c8aa41c7aeb422f253f5d23 (diff) | |
download | otp-4a055a655e1f82639b261689e56cbf2f1dc2d5c3.tar.gz otp-4a055a655e1f82639b261689e56cbf2f1dc2d5c3.tar.bz2 otp-4a055a655e1f82639b261689e56cbf2f1dc2d5c3.zip |
Allow chars_limit to limit strings
Earlier, only reports and {Format,Args} was limited by chars_limit,
and max_size was needed to limit the size of a string.
Diffstat (limited to 'lib/kernel/test/logger_formatter_SUITE.erl')
-rw-r--r-- | lib/kernel/test/logger_formatter_SUITE.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/kernel/test/logger_formatter_SUITE.erl b/lib/kernel/test/logger_formatter_SUITE.erl index 934fe4deef..eaa6c0aca5 100644 --- a/lib/kernel/test/logger_formatter_SUITE.erl +++ b/lib/kernel/test/logger_formatter_SUITE.erl @@ -269,8 +269,8 @@ format_msg(_Config) -> String8 = format(info,{string,['not',printable,list]}, #{report_cb=>fun(_)-> {"formatted",[]} end}, #{template=>Template}), - ct:log(String8), - "INVALID STRING: ['not',printable,list]" = String8, + ct:log("~ts",[String8]), % avoiding ct_log crash + "FORMAT ERROR: \"~ts\" - [['not',printable,list]]" = String8, String9 = format(info,{string,"string"},#{},#{template=>Template}), ct:log(String9), @@ -406,6 +406,14 @@ chars_limit(_Config) -> L5 = MS5, true = lists:prefix(lists:sublist(String5,L5-4),String4), + %% Test that chars_limit limits string also + Str = "123456789012345678901234567890123456789012345678901234567890123456789", + CL6 = 80, + String6 = format(info,{string,Str},Meta,FC#{chars_limit=>CL6}), + L6 = string:length(String6), + ct:log("String6: ~p~nLength6: ~p~n",[String6,L6]), + L6 = CL6, + ok. format_mfa(_Config) -> |