aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eunit/src/eunit_proc.erl
diff options
context:
space:
mode:
authorYuki Ito <[email protected]>2013-09-21 19:37:27 +0900
committerYuki Ito <[email protected]>2013-09-21 19:37:27 +0900
commitc666e8c99ad0974cd6fce047b8b1f9c9aacd4c19 (patch)
tree42213a594d198dfc3a1719cf5bd7ef3365c2245f /lib/eunit/src/eunit_proc.erl
parent589a9ed126d205007e79c22053d1b156a383d99f (diff)
downloadotp-c666e8c99ad0974cd6fce047b8b1f9c9aacd4c19.tar.gz
otp-c666e8c99ad0974cd6fce047b8b1f9c9aacd4c19.tar.bz2
otp-c666e8c99ad0974cd6fce047b8b1f9c9aacd4c19.zip
Fix I/O-protocol error handling in eunit
A io_request in eunit reuturns wrong value when it receive getopts or get_geometry request.
Diffstat (limited to 'lib/eunit/src/eunit_proc.erl')
-rw-r--r--lib/eunit/src/eunit_proc.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/eunit/src/eunit_proc.erl b/lib/eunit/src/eunit_proc.erl
index ec7d93fd48..03d1a18321 100644
--- a/lib/eunit/src/eunit_proc.erl
+++ b/lib/eunit/src/eunit_proc.erl
@@ -643,11 +643,11 @@ io_request({get_until, _Prompt, _M, _F, _As}, Buf) ->
io_request({setopts, _Opts}, Buf) ->
{ok, Buf};
io_request(getopts, Buf) ->
- {error, {error, enotsup}, Buf};
+ {{error, enotsup}, Buf};
io_request({get_geometry,columns}, Buf) ->
- {error, {error, enotsup}, Buf};
+ {{error, enotsup}, Buf};
io_request({get_geometry,rows}, Buf) ->
- {error, {error, enotsup}, Buf};
+ {{error, enotsup}, Buf};
io_request({requests, Reqs}, Buf) ->
io_requests(Reqs, {ok, Buf});
io_request(_, Buf) ->
@@ -657,3 +657,10 @@ io_requests([R | Rs], {ok, Buf}) ->
io_requests(Rs, io_request(R, Buf));
io_requests(_, Result) ->
Result.
+
+-ifdef(TEST).
+io_error_test_() ->
+ [?_assertMatch({error, enotsup}, io:getopts()),
+ ?_assertMatch({error, enotsup}, io:columns()),
+ ?_assertMatch({error, enotsup}, io:rows())].
+-endif.