Skip to content

Commit

Permalink
Merge branch 'sverk/bad_printable_range' into maint
Browse files Browse the repository at this point in the history
* sverk/bad_printable_range:
  stdlib: Fix io_SUITE:bad_printable_range for windows
  • Loading branch information
sverker committed Mar 8, 2016
2 parents 9bfbf43 + 48d6955 commit 652b67b
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions lib/stdlib/test/io_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2125,12 +2125,24 @@ rpc_call_max(Node, M, F, Args) ->
%% 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()
P = open_port({spawn, Cmd}, [stderr_to_stdout, {line, 200}]),
ok = receive
{P, {data, {eol , "bad range of printable characters" ++ _}}} ->
ok;
Other ->
Other
after 1000 ->
timeout
end,
catch port_close(P),
flush_from_port(P),
ok.

flush_from_port(P) ->
receive {P, _} ->
flush_from_port(P)
after 0 ->
ok
end.

io_lib_print_binary_depth_one(doc) ->
Expand Down

0 comments on commit 652b67b

Please sign in to comment.