1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-01 12:30:48 +02:00

Fix poor formatting and typos

This commit is contained in:
edholland
2015-10-04 13:18:06 +02:00
parent 9b46fe7e57
commit f7cfb3b194

View File

@@ -308,14 +308,14 @@ 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").
-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(0) -> 1;
fib(1) -> 1;
fib(N) when N > 1 -> fib(N-1) + fib(N-2).
fib_test_() ->
fib_test_() ->
[?_assert(fib(0) =:= 1),
?_assert(fib(1) =:= 1),
?_assert(fib(2) =:= 2),
@@ -326,7 +326,7 @@ self(). % <0.41.0>
?_assert(fib(31) =:= 2178309)
].
% EUnit will automatically export to a test() fucntion to allo running the tests
% EUnit will automatically export to a test() function to allow running the tests
% in the erlang shell
fib:test()