Permalink
Browse files

Renamed to lecture 8

  • Loading branch information...
1 parent 2d00210 commit fcccfa23565010644d7b3f1e21e043fa64731700 @giorgiosironi committed Nov 14, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/{fail_07.erl → fail_08.erl}
@@ -1,17 +1,17 @@
--module(fail_07).
+-module(fail_08).
-include_lib("eunit/include/eunit.hrl").
-export([parent/0, child/2]).
happy_path_test() ->
- Server = spawn(fail_07, parent, []),
+ Server = spawn(fail_08, parent, []),
Server ! {divide, 2, self()},
receive
{result, Result} -> Result
end,
?assertEqual(21, Result).
divide_by_zero_test() ->
- Server = spawn(fail_07, parent, []),
+ Server = spawn(fail_08, parent, []),
Server ! {divide, 0, self()},
Status = receive
{result, _} -> ok
@@ -30,7 +30,7 @@ parent() ->
parent_loop() ->
receive
{'EXIT', _Pid, {ErrorCode, _}} -> ErrorCode;
- {divide, Divisor, AnswerTo} -> spawn_link(fail_07, child, [Divisor, AnswerTo]);
+ {divide, Divisor, AnswerTo} -> spawn_link(fail_08, child, [Divisor, AnswerTo]);
{ping, AnswerTo} -> AnswerTo ! {pong, self()}
end,
parent_loop().

0 comments on commit fcccfa2

Please sign in to comment.