Skip to main content

EUnit

Basic Setup

Solution

-module(kata).
-export([add/2]).

add(A, B) -> A + B.
-module(kata).
-export([add/2]).

add(A, B) -> A + B.

Tests

-module(kata_tests).
-include_lib("eunit/include/eunit.hrl").

basic_test_() ->
  {"Basic tests",
    [{"add(1, 2) = 3", ?_assertMatch(3, kata:add(1, 2))}]}.
-module(kata_tests).
-include_lib("eunit/include/eunit.hrl").

basic_test_() ->
  {"Basic tests",
    [{"add(1, 2) = 3", ?_assertMatch(3, kata:add(1, 2))}]}.