1 -module(hope_result_SUITE).
3 %% TODO: Import only what is used.
4 -include_lib("proper/include/proper.hrl").
18 , t_hope_result_specs/1
22 -define(GROUP_PIPE, result_pipe).
23 -define(GROUP_SPEC, result_spec).
26 %% ============================================================================
27 %% Common Test callbacks
28 %% ============================================================================
31 [ {group, ?GROUP_PIPE}
32 , {group, ?GROUP_SPEC}
43 Properties = [parallel],
44 [ {?GROUP_PIPE, Properties, PipeTests}
45 , {?GROUP_SPEC, Properties, SpecTests}
48 init_per_group(?GROUP_SPEC, Cfg) ->
50 init_per_group(?GROUP_PIPE, Cfg) ->
52 [ fun (0) -> {ok, 1}; (X) -> {error, X} end
53 , fun (1) -> {ok, 2}; (X) -> {error, X} end
54 , fun (2) -> {ok, 3}; (X) -> {error, X} end
56 hope_kv_list:set(Cfg, steps, Steps).
58 end_per_group(?GROUP_SPEC, _Cfg) ->
60 end_per_group(?GROUP_PIPE, _Cfg) ->
64 %% =============================================================================
66 %% =============================================================================
69 {some, Steps} = hope_kv_list:get(Cfg, steps),
70 {ok, 3} = hope_result:pipe(Steps, 0).
73 {some, Steps} = hope_kv_list:get(Cfg, steps),
74 {error, 1} = hope_result:pipe(Steps, 1).
76 t_hope_result_specs(_) ->
77 [] = proper:check_specs(hope_result).