idea project + task1 fib_P + tests (passed)

This commit is contained in:
Ivan I. Ovchinnikov 2023-02-10 00:29:26 +03:00
parent 862b327b81
commit 058a522263
3 changed files with 37 additions and 0 deletions

17
erlang.iml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="ERLANG_MODULE" version="4">
<component name="FacetManager">
<facet type="erlang" name="Erlang">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="jdk" jdkName="Erlang 25" jdkType="Erlang SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

7
src/fib.erl Normal file
View File

@ -0,0 +1,7 @@
-module(fib).
-export([fib_p/1]).
% Сопоставление с образцом
fib_p(0) -> 0;
fib_p(1) -> 1;
fib_p(N) -> fib_p(N - 1) + fib_p(N - 2).

13
test/fib_test.erl Normal file
View File

@ -0,0 +1,13 @@
%%%-------------------------------------------------------------------
%%% @author ivan
%%% @copyright (C) 2023, self
%%% @doc
%%%
%%% @end
%%% Created : 09. Feb 2023 23:52
%%%-------------------------------------------------------------------
-module(fib_test).
-include_lib("eunit/include/eunit.hrl").
simple_test() ->
?assert(true).