Skip to content

Commit

Permalink
eliminate pointless diffs between this code and the version in OTP
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Carlsson committed Dec 21, 2014
1 parent be793f0 commit 4580fe6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
3 changes: 2 additions & 1 deletion src/eunit_server.erl
Expand Up @@ -205,7 +205,8 @@ server_command(From, stop, St) ->
server(St#state{stopped = true});
server_command(From, {watch, Target, _Opts}, St) ->
%% the code watcher is only started on demand
code_monitor:monitor(self()),
%% FIXME: this is disabled for now in the OTP distribution
%%code_monitor:monitor(self()),
%% TODO: propagate options to testing stage
St1 = add_watch(Target, St),
server_command_reply(From, ok),
Expand Down
60 changes: 30 additions & 30 deletions src/eunit_test.erl
Expand Up @@ -143,20 +143,20 @@ macro_test_() ->
= run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertNotMatch(ok, error),
{ok, ok} = run_testfun(F)
end),
{?LINE, F} = ?_assertNotMatch(ok, error),
{ok, ok} = run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertNotMatch([_], [42]),
{error,{error,{assertNotMatch_failed,
{?LINE, F} = ?_assertNotMatch([_], [42]),
{error,{error,{assertNotMatch_failed,
[{module,_},
{line,_},
{expression,_},
{pattern,"[ _ ]"},
{value,[42]}]},
_}}
= run_testfun(F)
end),
end),
?_test(begin
{?LINE, F} = ?_assertEqual(ok, ok),
{ok, ok} = run_testfun(F)
Expand All @@ -173,19 +173,19 @@ macro_test_() ->
= run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertNotEqual(1, 0),
{ok, ok} = run_testfun(F)
end),
{?LINE, F} = ?_assertNotEqual(1, 0),
{ok, ok} = run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertNotEqual(2, 1+1),
{error,{error,{assertNotEqual_failed,
{?LINE, F} = ?_assertNotEqual(2, 1+1),
{error,{error,{assertNotEqual_failed,
[{module,_},
{line,_},
{expression,_},
{value,2}]},
_}}
= run_testfun(F)
end),
end),
?_test(begin
{?LINE, F} = ?_assertException(error, badarith,
erlang:error(badarith)),
Expand Down Expand Up @@ -214,33 +214,33 @@ macro_test_() ->
{error,badarith,_}}]},
_}}
= run_testfun(F)
end),
end),
?_test(begin
{?LINE, F} = ?_assertError(badarith,
{?LINE, F} = ?_assertError(badarith,
erlang:error(badarith)),
{ok, ok} = run_testfun(F)
end),
{ok, ok} = run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertExit(normal, exit(normal)),
{ok, ok} = run_testfun(F)
end),
{?LINE, F} = ?_assertExit(normal, exit(normal)),
{ok, ok} = run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertThrow(foo, throw(foo)),
{ok, ok} = run_testfun(F)
end),
{?LINE, F} = ?_assertThrow(foo, throw(foo)),
{ok, ok} = run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertNotException(error, badarith, 42),
{ok, ok} = run_testfun(F)
end),
{?LINE, F} = ?_assertNotException(error, badarith, 42),
{ok, ok} = run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertNotException(error, badarith,
{?LINE, F} = ?_assertNotException(error, badarith,
erlang:error(badarg)),
{ok, ok} = run_testfun(F)
end),
{ok, ok} = run_testfun(F)
end),
?_test(begin
{?LINE, F} = ?_assertNotException(error, badarith,
{?LINE, F} = ?_assertNotException(error, badarith,
erlang:error(badarith)),
{error,{error,{assertNotException_failed,
{error,{error,{assertNotException_failed,
[{module,_},
{line,_},
{expression,_},
Expand Down

0 comments on commit 4580fe6

Please sign in to comment.