diff options
author | Hans Bolinder <[email protected]> | 2018-06-11 12:38:41 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-06-11 12:38:41 +0200 |
commit | c2d0170c32402a7ddb6657be72f5bf5786fa298b (patch) | |
tree | a35b4e25c729b4c19accb1b21594dbb65f48f83b /lib/stdlib/test/io_SUITE.erl | |
parent | cf2ad431487cb533aac2854843aa61b8e1e5af62 (diff) | |
parent | 7a5ae72a5f46059d8c862a4e5964b4799d1fda4b (diff) | |
download | otp-c2d0170c32402a7ddb6657be72f5bf5786fa298b.tar.gz otp-c2d0170c32402a7ddb6657be72f5bf5786fa298b.tar.bz2 otp-c2d0170c32402a7ddb6657be72f5bf5786fa298b.zip |
Merge branch 'hasse/stdlib/pP_with_no_line_breaks/OTP-15103/ERL-607'
* hasse/stdlib/pP_with_no_line_breaks/OTP-15103/ERL-607:
kernel: Use ~0p
debugger: Use ~0p
common_test: Use ~0p
stdlib: Make pP insert no line breaks with field width zero
Diffstat (limited to 'lib/stdlib/test/io_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/io_SUITE.erl | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 13f2cbd27b..91fe1133f6 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -31,7 +31,7 @@ otp_10836/1, io_lib_width_too_small/1, io_with_huge_message_queue/1, format_string/1, maps/1, coverage/1, otp_14178_unicode_atoms/1, otp_14175/1, - otp_14285/1, limit_term/1, otp_14983/1]). + otp_14285/1, limit_term/1, otp_14983/1, otp_15103/1]). -export([pretty/2, trf/3]). @@ -63,7 +63,7 @@ all() -> io_lib_print_binary_depth_one, otp_10302, otp_10755, otp_10836, io_lib_width_too_small, io_with_huge_message_queue, format_string, maps, coverage, otp_14178_unicode_atoms, otp_14175, - otp_14285, limit_term, otp_14983]. + otp_14285, limit_term, otp_14983, otp_15103]. %% Error cases for output. error_1(Config) when is_list(Config) -> @@ -2615,3 +2615,21 @@ trf(Format, Args, T) -> trf(Format, Args, T, Opts) -> lists:flatten(io_lib:format(Format, Args, [{chars_limit, T}|Opts])). + +otp_15103(_Config) -> + T = lists:duplicate(5, {a,b,c}), + + S1 = io_lib:format("~0p", [T]), + "[{a,b,c},{a,b,c},{a,b,c},{a,b,c},{a,b,c}]" = lists:flatten(S1), + S2 = io_lib:format("~-0p", [T]), + "[{a,b,c},{a,b,c},{a,b,c},{a,b,c},{a,b,c}]" = lists:flatten(S2), + S3 = io_lib:format("~1p", [T]), + "[{a,\n b,\n c},\n {a,\n b,\n c},\n {a,\n b,\n c},\n {a,\n b,\n" + " c},\n {a,\n b,\n c}]" = lists:flatten(S3), + + S4 = io_lib:format("~0P", [T, 5]), + "[{a,b,c},{a,b,...},{a,...},{...}|...]" = lists:flatten(S4), + S5 = io_lib:format("~1P", [T, 5]), + "[{a,\n b,\n c},\n {a,\n b,...},\n {a,...},\n {...}|...]" = + lists:flatten(S5), + ok. |