X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=test%2Fhope_result_SUITE.erl;fp=test%2Fhope_result_SUITE.erl;h=618713d4bdb1efb6b2a9817960345aa6da7567be;hb=7e9d7f2cba7c91e2ae1dab489860f19bce9cbdc3;hp=0000000000000000000000000000000000000000;hpb=3efbdbc9782dc7d9a9f6c3d7e0305978950c5236;p=hope.git diff --git a/test/hope_result_SUITE.erl b/test/hope_result_SUITE.erl new file mode 100644 index 0000000..618713d --- /dev/null +++ b/test/hope_result_SUITE.erl @@ -0,0 +1,45 @@ +-module(hope_result_SUITE). + +%% Callbacks +-export( + [ all/0 + , groups/0 + ]). + +%% Test cases +-export( + [ t_pipe/1 + ]). + + +-define(GROUP_PIPE, result_pipe). + + +%% ============================================================================ +%% Common Test callbacks +%% ============================================================================ + +all() -> + [{group, ?GROUP_PIPE}]. + +groups() -> + Tests = + [ t_pipe + ], + Properties = [], + [{?GROUP_PIPE, Properties, Tests}]. + + +%% ============================================================================= +%% Test cases +%% ============================================================================= + +t_pipe(_Config) -> + A = foo, + Z = qux, + Steps = + [ fun (foo) -> {ok, bar}; (X) -> {error, X} end + , fun (bar) -> {ok, baz}; (X) -> {error, X} end + , fun (baz) -> {ok, qux}; (X) -> {error, X} end + ], + {ok, Z} = hope_result:pipe(Steps, A).