From 2520c46a2aac90aba0871d33b76c3e0a431777c0 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Tue, 5 Oct 2021 12:48:05 -0300 Subject: [PATCH] Exercism: Hello world --- erlang/hello-world/.eunit/hello_world.erl | 6 +++ .../hello-world/.eunit/hello_world_tests.erl | 34 ++++++++++++++ erlang/hello-world/.exercism/config.json | 30 +++++++++++++ erlang/hello-world/.exercism/metadata.json | 1 + erlang/hello-world/.qc/hello_world.erl | 6 +++ erlang/hello-world/.qc/hello_world_tests.erl | 34 ++++++++++++++ erlang/hello-world/.rebar/erlcinfo | Bin 0 -> 209 bytes erlang/hello-world/HELP.md | 36 +++++++++++++++ erlang/hello-world/README.md | 42 ++++++++++++++++++ erlang/hello-world/rebar.config | 30 +++++++++++++ erlang/hello-world/src/hello_world.app.src | 9 ++++ erlang/hello-world/src/hello_world.erl | 6 +++ erlang/hello-world/test/hello_world_tests.erl | 34 ++++++++++++++ 13 files changed, 268 insertions(+) create mode 100644 erlang/hello-world/.eunit/hello_world.erl create mode 100644 erlang/hello-world/.eunit/hello_world_tests.erl create mode 100644 erlang/hello-world/.exercism/config.json create mode 100644 erlang/hello-world/.exercism/metadata.json create mode 100644 erlang/hello-world/.qc/hello_world.erl create mode 100644 erlang/hello-world/.qc/hello_world_tests.erl create mode 100644 erlang/hello-world/.rebar/erlcinfo create mode 100644 erlang/hello-world/HELP.md create mode 100644 erlang/hello-world/README.md create mode 100644 erlang/hello-world/rebar.config create mode 100644 erlang/hello-world/src/hello_world.app.src create mode 100644 erlang/hello-world/src/hello_world.erl create mode 100644 erlang/hello-world/test/hello_world_tests.erl diff --git a/erlang/hello-world/.eunit/hello_world.erl b/erlang/hello-world/.eunit/hello_world.erl new file mode 100644 index 0000000..0707317 --- /dev/null +++ b/erlang/hello-world/.eunit/hello_world.erl @@ -0,0 +1,6 @@ +-module(hello_world). + +-export([hello/0]). + +hello() -> + "Goodbye, Mars!". diff --git a/erlang/hello-world/.eunit/hello_world_tests.erl b/erlang/hello-world/.eunit/hello_world_tests.erl new file mode 100644 index 0000000..06261b6 --- /dev/null +++ b/erlang/hello-world/.eunit/hello_world_tests.erl @@ -0,0 +1,34 @@ +%% Generated with 'testgen v0.2.0' +%% Revision 1 of the exercises generator was used +%% https://github.com/exercism/problem-specifications/raw/42dd0cea20498fd544b152c4e2c0a419bb7e266a/exercises/hello-world/canonical-data.json +%% This file is automatically generated from the exercises canonical data. + +-module(hello_world_tests). + +-include_lib("erl_exercism/include/exercism.hrl"). +-include_lib("eunit/include/eunit.hrl"). + + +-define(assertStringEqual(Expect, Expr), + begin ((fun () -> + __X = (Expect), + __Y = (Expr), + case string:equal(__X, __Y) of + true -> ok; + false -> erlang:error({assertStringEqual, + [{module, ?MODULE}, + {line, ?LINE}, + {expression, (??Expr)}, + {expected, unicode:characters_to_list(__X)}, + {value, unicode:characters_to_list(__Y)}]}) + end + end)()) + end). + +-define(_assertStringEqual(Expect, Expr), ?_test(?assertStringEqual(Expect, Expr))). + + +'1_say_hi_test_'() -> + {"Say Hi!", + ?_assertStringEqual("Hello, World!", + hello_world:hello())}. diff --git a/erlang/hello-world/.exercism/config.json b/erlang/hello-world/.exercism/config.json new file mode 100644 index 0000000..113f8b6 --- /dev/null +++ b/erlang/hello-world/.exercism/config.json @@ -0,0 +1,30 @@ +{ + "blurb": "The classical introductory exercise. Just say \"Hello, World!\"", + "authors": [ + "barberj" + ], + "contributors": [ + "duffn", + "ErikSchierboom", + "iHiD", + "JordanAdams", + "juhlig", + "kytrinyx", + "NobbZ", + "tmcgilchrist", + "xymbol" + ], + "files": { + "solution": [ + "src/hello_world.erl" + ], + "test": [ + "test/hello_world_tests.erl" + ], + "example": [ + ".meta/example.erl" + ] + }, + "source": "This is an exercise to introduce users to using Exercism", + "source_url": "http://en.wikipedia.org/wiki/%22Hello,_world!%22_program" +} diff --git a/erlang/hello-world/.exercism/metadata.json b/erlang/hello-world/.exercism/metadata.json new file mode 100644 index 0000000..5408727 --- /dev/null +++ b/erlang/hello-world/.exercism/metadata.json @@ -0,0 +1 @@ +{"track":"erlang","exercise":"hello-world","id":"d3e91fc949c14f3b946bf72f8fabff37","url":"https://exercism.org/tracks/erlang/exercises/hello-world","handle":"JBiason","is_requester":true,"auto_approve":false} \ No newline at end of file diff --git a/erlang/hello-world/.qc/hello_world.erl b/erlang/hello-world/.qc/hello_world.erl new file mode 100644 index 0000000..0707317 --- /dev/null +++ b/erlang/hello-world/.qc/hello_world.erl @@ -0,0 +1,6 @@ +-module(hello_world). + +-export([hello/0]). + +hello() -> + "Goodbye, Mars!". diff --git a/erlang/hello-world/.qc/hello_world_tests.erl b/erlang/hello-world/.qc/hello_world_tests.erl new file mode 100644 index 0000000..06261b6 --- /dev/null +++ b/erlang/hello-world/.qc/hello_world_tests.erl @@ -0,0 +1,34 @@ +%% Generated with 'testgen v0.2.0' +%% Revision 1 of the exercises generator was used +%% https://github.com/exercism/problem-specifications/raw/42dd0cea20498fd544b152c4e2c0a419bb7e266a/exercises/hello-world/canonical-data.json +%% This file is automatically generated from the exercises canonical data. + +-module(hello_world_tests). + +-include_lib("erl_exercism/include/exercism.hrl"). +-include_lib("eunit/include/eunit.hrl"). + + +-define(assertStringEqual(Expect, Expr), + begin ((fun () -> + __X = (Expect), + __Y = (Expr), + case string:equal(__X, __Y) of + true -> ok; + false -> erlang:error({assertStringEqual, + [{module, ?MODULE}, + {line, ?LINE}, + {expression, (??Expr)}, + {expected, unicode:characters_to_list(__X)}, + {value, unicode:characters_to_list(__Y)}]}) + end + end)()) + end). + +-define(_assertStringEqual(Expect, Expr), ?_test(?assertStringEqual(Expect, Expr))). + + +'1_say_hi_test_'() -> + {"Say Hi!", + ?_assertStringEqual("Hello, World!", + hello_world:hello())}. diff --git a/erlang/hello-world/.rebar/erlcinfo b/erlang/hello-world/.rebar/erlcinfo new file mode 100644 index 0000000000000000000000000000000000000000..a7b8698b4a6ef25fba207677bc8729c915e9001d GIT binary patch literal 209 zcmV;?051Q7Pyhe{`gmTYkxdH1Fc5{OKcYx?;>L|G1Xm`smf~&7w27uMw2-8DE)V5B zOaw(i1$8yd@ZL9%84)oUajoj6-E|m>NC7}B!UJq+Z!}d+RpitOu-*HH8p~W+Z%CSx zjAXQFYt=JO(HO2R5n2gHsQ`v2OmHqDoFX82;>>bmso+X=<+0O>m40A|qu)Gd9OJ-w z5?tWQdnQKLkCu<(^mSz3w~bwAq_~H@PTppf{sy6leF+$ZOOC + "Hello, World!". diff --git a/erlang/hello-world/test/hello_world_tests.erl b/erlang/hello-world/test/hello_world_tests.erl new file mode 100644 index 0000000..06261b6 --- /dev/null +++ b/erlang/hello-world/test/hello_world_tests.erl @@ -0,0 +1,34 @@ +%% Generated with 'testgen v0.2.0' +%% Revision 1 of the exercises generator was used +%% https://github.com/exercism/problem-specifications/raw/42dd0cea20498fd544b152c4e2c0a419bb7e266a/exercises/hello-world/canonical-data.json +%% This file is automatically generated from the exercises canonical data. + +-module(hello_world_tests). + +-include_lib("erl_exercism/include/exercism.hrl"). +-include_lib("eunit/include/eunit.hrl"). + + +-define(assertStringEqual(Expect, Expr), + begin ((fun () -> + __X = (Expect), + __Y = (Expr), + case string:equal(__X, __Y) of + true -> ok; + false -> erlang:error({assertStringEqual, + [{module, ?MODULE}, + {line, ?LINE}, + {expression, (??Expr)}, + {expected, unicode:characters_to_list(__X)}, + {value, unicode:characters_to_list(__Y)}]}) + end + end)()) + end). + +-define(_assertStringEqual(Expect, Expr), ?_test(?assertStringEqual(Expect, Expr))). + + +'1_say_hi_test_'() -> + {"Say Hi!", + ?_assertStringEqual("Hello, World!", + hello_world:hello())}.