New Fetch
This commit is contained in:
11
erlang/hello-world/include/exercism.hrl
Normal file
11
erlang/hello-world/include/exercism.hrl
Normal file
@@ -0,0 +1,11 @@
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
sut(Module) ->
|
||||
{ok, Files} = file:list_dir("./src"),
|
||||
case lists:member("example.erl", Files) of
|
||||
true -> example;
|
||||
false -> Module
|
||||
end.
|
||||
|
||||
version_test() ->
|
||||
?assertMatch(?TEST_VERSION, ?TESTED_MODULE:test_version()).
|
30
erlang/hello-world/rebar.config
Normal file
30
erlang/hello-world/rebar.config
Normal file
@@ -0,0 +1,30 @@
|
||||
%% Erlang compiler options
|
||||
{erl_opts, [debug_info]}.
|
||||
|
||||
{deps, []}.
|
||||
|
||||
{dialyzer, [
|
||||
{warnings, [underspecs, no_return]},
|
||||
{get_warnings, true},
|
||||
{plt_apps, top_level_deps}, % top_level_deps | all_deps
|
||||
{plt_extra_apps, []},
|
||||
{plt_location, local}, % local | "/my/file/name"
|
||||
{plt_prefix, "rebar3"},
|
||||
{base_plt_apps, [stdlib, kernel, crypto]},
|
||||
{base_plt_location, global}, % global | "/my/file/name"
|
||||
{base_plt_prefix, "rebar3"}
|
||||
]}.
|
||||
|
||||
%% eunit:test(Tests)
|
||||
{eunit_tests, []}.
|
||||
%% Options for eunit:test(Tests, Opts)
|
||||
{eunit_opts, [verbose]}.
|
||||
|
||||
%% == xref ==
|
||||
|
||||
{xref_warnings, true}.
|
||||
|
||||
%% xref checks to run
|
||||
{xref_checks, [undefined_function_calls, undefined_functions,
|
||||
locals_not_used, exports_not_used,
|
||||
deprecated_function_calls, deprecated_functions]}.
|
9
erlang/hello-world/src/hello_world.app.src
Normal file
9
erlang/hello-world/src/hello_world.app.src
Normal file
@@ -0,0 +1,9 @@
|
||||
{application, hello_world,
|
||||
[{description, "exercism.io - hello-world"},
|
||||
{vsn, "0.0.1"},
|
||||
{modules, []},
|
||||
{registered, []},
|
||||
{applications, [kernel,
|
||||
stdlib]},
|
||||
{env, []}
|
||||
]}.
|
8
erlang/hello-world/src/hello_world.erl
Normal file
8
erlang/hello-world/src/hello_world.erl
Normal file
@@ -0,0 +1,8 @@
|
||||
-module(hello_world).
|
||||
|
||||
-export([hello/0, test_version/0]).
|
||||
|
||||
hello() ->
|
||||
undefined.
|
||||
|
||||
test_version() -> 2.
|
9
erlang/hello-world/test/hello_world_tests.erl
Normal file
9
erlang/hello-world/test/hello_world_tests.erl
Normal file
@@ -0,0 +1,9 @@
|
||||
-module(hello_world_tests).
|
||||
|
||||
-define(TESTED_MODULE, (sut(hello_world))).
|
||||
-define(TEST_VERSION, 2).
|
||||
-include("exercism.hrl").
|
||||
|
||||
|
||||
say_hi_test() ->
|
||||
?assertEqual("Hello, World!", ?TESTED_MODULE:hello()).
|
Reference in New Issue
Block a user