X-Git-Url: https://git.xandkar.net/?p=hope.git;a=blobdiff_plain;f=test%2Fhope_fun_SUITE.erl;h=910cc494e6669c646539484f30e42cca1c57e97b;hp=d4e2281aa446edd229bf7ab8d8daaf11af777182;hb=e033aadea66cc7f68e3a66cde23a2edfe4c4e9e6;hpb=99fd18ae3aa61238700208a5f2b2959c1b1a2d80 diff --git a/test/hope_fun_SUITE.erl b/test/hope_fun_SUITE.erl index d4e2281..910cc49 100644 --- a/test/hope_fun_SUITE.erl +++ b/test/hope_fun_SUITE.erl @@ -9,6 +9,7 @@ %% Test cases -export( [ t_id/1 + , t_curry/1 ]). @@ -26,6 +27,7 @@ all() -> groups() -> Tests = [ t_id + , t_curry ], Properties = [parallel], [ {?GROUP, Properties, Tests} @@ -39,3 +41,20 @@ groups() -> t_id(_Cfg) -> X = foo, X = hope_fun:id(X). + +t_curry(_Cfg) -> + Single = fun (X) -> X end, + Double = fun (X, Y) -> {X, Y} end, + Triple = fun (X, Y, Z) -> {X, Y, Z} end, + + F = hope_fun:curry(Single), + a = F(a), + + G1 = hope_fun:curry(Double), + G = G1(a), + {a, b} = G(b), + + H1 = hope_fun:curry(Triple), + H2 = H1(a), + H = H2(b), + {a, b, c} = H(c).