actual fib_p tests passing

This commit is contained in:
Ivan I. Ovchinnikov 2023-02-10 00:43:22 +03:00
parent 058a522263
commit 5bbdefb4a6
1 changed files with 16 additions and 2 deletions

View File

@ -9,5 +9,19 @@
-module(fib_test). -module(fib_test).
-include_lib("eunit/include/eunit.hrl"). -include_lib("eunit/include/eunit.hrl").
simple_test() -> fib_test_() -> [
?assert(true). {"Test fib_p", fun test_fib_p/0 }
].
test_fib_p() ->
?assertEqual(0, fib:fib_p(0)),
?assertEqual(1, fib:fib_p(1)),
?assertEqual(1, fib:fib_p(2)),
?assertEqual(2, fib:fib_p(3)),
?assertEqual(3, fib:fib_p(4)),
?assertEqual(5, fib:fib_p(5)),
?assertEqual(8, fib:fib_p(6)),
?assertEqual(13, fib:fib_p(7)),
?assertEqual(21, fib:fib_p(8)),
?assertEqual(34, fib:fib_p(9)),
?assertEqual(55, fib:fib_p(10)).