diff options
author | ven <vendethiel@hotmail.fr> | 2015-10-04 20:43:07 +0200 |
---|---|---|
committer | ven <vendethiel@hotmail.fr> | 2015-10-04 20:43:07 +0200 |
commit | c1cfa3728836ff1729629b6af74f792f7c0d9af6 (patch) | |
tree | 8189d8816fc5f6be75e68e24f9f598f8a1ab4a55 /erlang.html.markdown | |
parent | ff5c833f13ff279245cc099128416889f62b8013 (diff) | |
parent | f7cfb3b194ff4fb590173cb7e790c4effc1656c0 (diff) |
Merge pull request #1331 from edholland/fix-typos
Fix poor formatting and typos
Diffstat (limited to 'erlang.html.markdown')
-rw-r--r-- | erlang.html.markdown | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/erlang.html.markdown b/erlang.html.markdown index 64330867..48cee6ec 100644 --- a/erlang.html.markdown +++ b/erlang.html.markdown @@ -308,25 +308,25 @@ self(). % <0.41.0> % Unit tests can be written using EUnits's test generators and assert macros -module(fib). - -export([fib/1]). - -include_lib("eunit/include/eunit.hrl"). - - fib(0) -> 1; - fib(1) -> 1; - fib(N) when N > 1 -> fib(N-1) + fib(N-2). - - fib_test_() -> - [?_assert(fib(0) =:= 1), - ?_assert(fib(1) =:= 1), - ?_assert(fib(2) =:= 2), - ?_assert(fib(3) =:= 3), - ?_assert(fib(4) =:= 5), - ?_assert(fib(5) =:= 8), - ?_assertException(error, function_clause, fib(-1)), - ?_assert(fib(31) =:= 2178309) - ]. - -% EUnit will automatically export to a test() fucntion to allo running the tests +-export([fib/1]). +-include_lib("eunit/include/eunit.hrl"). + +fib(0) -> 1; +fib(1) -> 1; +fib(N) when N > 1 -> fib(N-1) + fib(N-2). + +fib_test_() -> + [?_assert(fib(0) =:= 1), + ?_assert(fib(1) =:= 1), + ?_assert(fib(2) =:= 2), + ?_assert(fib(3) =:= 3), + ?_assert(fib(4) =:= 5), + ?_assert(fib(5) =:= 8), + ?_assertException(error, function_clause, fib(-1)), + ?_assert(fib(31) =:= 2178309) + ]. + +% EUnit will automatically export to a test() function to allow running the tests % in the erlang shell fib:test() |