aboutsummaryrefslogtreecommitdiff
path: root/gen/tuple.erl
blob: 270bb290a576573f605662559fb819edaaf2790f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-module(tuple).
-compile(no_auto_import).
-include_lib("eunit/include/eunit.hrl").

-export([first/1, second/1]).

first(Tup) ->
    {A, _} = Tup,
    A.

-ifdef(TEST).
first_test() ->
    expect:equal(first({1, 2}), 1).
-endif.

second(Tup) ->
    {_, A} = Tup,
    A.

-ifdef(TEST).
second_test() ->
    expect:equal(second({1, 2}), 2).
-endif.