910cc494e6669c646539484f30e42cca1c57e97b
[hope.git] / test / hope_fun_SUITE.erl
1 -module(hope_fun_SUITE).
2
3 %% Callbacks
4 -export(
5 [ all/0
6 , groups/0
7 ]).
8
9 %% Test cases
10 -export(
11 [ t_id/1
12 , t_curry/1
13 ]).
14
15
16 -define(GROUP, hope_fun).
17
18
19 %% ============================================================================
20 %% Common Test callbacks
21 %% ============================================================================
22
23 all() ->
24 [ {group, ?GROUP}
25 ].
26
27 groups() ->
28 Tests =
29 [ t_id
30 , t_curry
31 ],
32 Properties = [parallel],
33 [ {?GROUP, Properties, Tests}
34 ].
35
36
37 %% =============================================================================
38 %% Test cases
39 %% =============================================================================
40
41 t_id(_Cfg) ->
42 X = foo,
43 X = hope_fun:id(X).
44
45 t_curry(_Cfg) ->
46 Single = fun (X) -> X end,
47 Double = fun (X, Y) -> {X, Y} end,
48 Triple = fun (X, Y, Z) -> {X, Y, Z} end,
49
50 F = hope_fun:curry(Single),
51 a = F(a),
52
53 G1 = hope_fun:curry(Double),
54 G = G1(a),
55 {a, b} = G(b),
56
57 H1 = hope_fun:curry(Triple),
58 H2 = H1(a),
59 H = H2(b),
60 {a, b, c} = H(c).
This page took 0.041251 seconds and 3 git commands to generate.