diff options
author | Björn Gustavsson <[email protected]> | 2015-09-08 08:43:04 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-09-11 12:24:33 +0200 |
commit | 25e79a057a6839287271fc7a04a03f7e6f04652d (patch) | |
tree | e5c12a8e4186c1e0cb3a15588929df7216ac15bf | |
parent | 3213c682e47f151283697a7a00f38bf2fbee670f (diff) | |
download | otp-25e79a057a6839287271fc7a04a03f7e6f04652d.tar.gz otp-25e79a057a6839287271fc7a04a03f7e6f04652d.tar.bz2 otp-25e79a057a6839287271fc7a04a03f7e6f04652d.zip |
io_SUITE: Add coverage/1 to completely cover io_lib_pretty
-rw-r--r-- | lib/stdlib/test/io_SUITE.erl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 6e7e1584d9..0e897631ff 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -33,7 +33,7 @@ io_lib_print_binary_depth_one/1, otp_10302/1, otp_10755/1, otp_10836/1, io_lib_width_too_small/1, io_with_huge_message_queue/1, format_string/1, - maps/1]). + maps/1, coverage/1]). -export([pretty/2]). @@ -74,7 +74,7 @@ all() -> printable_range, bad_printable_range, 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]. + format_string, maps, coverage]. groups() -> []. @@ -2390,3 +2390,14 @@ parse_skip_ws([C|S]) when C =< $\s -> parse_skip_ws(S); parse_skip_ws(S) -> S. + +%% Cover the last uncovered lines for completeness. +coverage(_Config) -> + S1 = io_lib_pretty:print({a,term}, fun(_, _) -> no end), + io:format("~s\n", [S1]), + + %% The tuple of arity three will be ignored. + S2 = io_lib_pretty:print(lists:seq(1, 100), [{depth,1,1}]), + io:format("~s\n", [S2]), + + ok. |