aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-09-01 09:52:07 +0200
committerBjörn Gustavsson <[email protected]>2015-09-11 12:23:09 +0200
commit9d0f9ed8b6a055e069e26f77622985cd434378f9 (patch)
tree1dc75b8647771a983708b2cdd49de4ccf65dfe24 /lib/stdlib
parent9ca2503cbbc7247108278ff2f5b9fe2b37450833 (diff)
downloadotp-9d0f9ed8b6a055e069e26f77622985cd434378f9.tar.gz
otp-9d0f9ed8b6a055e069e26f77622985cd434378f9.tar.bz2
otp-9d0f9ed8b6a055e069e26f77622985cd434378f9.zip
io_SUITE: Speed up test for bad +pc option
Move the test for a bad +pc option to its own test case for cleanliness. Use the os:cmd/1 function to avoid the annyoying 30 seconds time-out in test_server:start_node/3.
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/test/io_SUITE.erl17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl
index a290674524..8a6b2725af 100644
--- a/lib/stdlib/test/io_SUITE.erl
+++ b/lib/stdlib/test/io_SUITE.erl
@@ -29,7 +29,7 @@
manpage/1, otp_6708/1, otp_7084/1, otp_7421/1,
io_lib_collect_line_3_wb/1, cr_whitespace_in_string/1,
io_fread_newlines/1, otp_8989/1, io_lib_fread_literal/1,
- printable_range/1,
+ printable_range/1, bad_printable_range/1,
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,
@@ -71,7 +71,7 @@ all() ->
manpage, otp_6708, otp_7084, otp_7421,
io_lib_collect_line_3_wb, cr_whitespace_in_string,
io_fread_newlines, otp_8989, io_lib_fread_literal,
- printable_range,
+ 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].
@@ -2063,8 +2063,6 @@ printable_range(Suite) when is_list(Suite) ->
[{args, " +pclatin1 -pa " ++ Pa}]),
unicode = rpc:call(UNode,io,printable_range,[]),
latin1 = rpc:call(LNode,io,printable_range,[]),
- {error, _} = test_server:start_node(printable_range_unnicode, slave,
- [{args, " +pcunnicode -pa " ++ Pa}]),
PrettyOptions = [{column,1},
{line_length,109},
{depth,30},
@@ -2114,6 +2112,17 @@ printable_range(Suite) when is_list(Suite) ->
test_server:stop_node(DNode),
ok.
+%% Make sure that a bad specification for a printable range is rejected.
+bad_printable_range(Config) when is_list(Config) ->
+ Cmd = lists:concat([lib:progname()," +pcunnnnnicode -run erlang halt"]),
+ case os:cmd(Cmd) of
+ "bad range of printable characters" ++ _ ->
+ ok;
+ String ->
+ io:format("~s\n", [String]),
+ ?t:fail()
+ end.
+
io_lib_print_binary_depth_one(doc) ->
"Test binaries printed with a depth of one behave correctly";
io_lib_print_binary_depth_one(Suite) when is_list(Suite) ->