1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
-module(mem3_test).
-include("../include/common.hrl").
-include_lib("eunit/include/eunit.hrl").
%% TEST SETUP
all_tests_test_() ->
{"membership3 tests",
[
{setup,
fun test_setup/0,
fun test_teardown/1,
fun(Pid) ->
{with, Pid,
[
fun init/1,
fun join_first/1
]}
end}
]
}.
test_setup() ->
{ok, Pid} = mem3:start_link(test),
Pid.
test_teardown(Pid) ->
exit(Pid, shutdown).
%% TESTS
init(_Pid) ->
#mem{test=Test} = mem3:state(),
?assertEqual(true, Test).
join_first(_Pid) ->
mem3:join(first, [{1, a, []}, {2, b, []}]),
?debugFmt("~nState: ~p~n", [mem3:state()]),
ok.
|