X-Git-Url: https://git.xandkar.net/?p=hope.git;a=blobdiff_plain;f=test%2Fhope_option_SUITE.erl;h=370cf24daeb5ac4fbe19a7439509fed525324eef;hp=8789d3d8e021fba5569b8552a87f6ad36a399534;hb=f2e1fffc2e9ce505ae1891a2251ae2036ed13422;hpb=781f182fe399d95fc144ba3b47112e803ba6af6e diff --git a/test/hope_option_SUITE.erl b/test/hope_option_SUITE.erl index 8789d3d..370cf24 100644 --- a/test/hope_option_SUITE.erl +++ b/test/hope_option_SUITE.erl @@ -9,6 +9,7 @@ %% Test cases -export( [ t_of_result/1 + , t_of_undefined/1 , t_put/1 , t_get/1 , t_map/1 @@ -31,6 +32,7 @@ all() -> groups() -> Tests = [ t_of_result + , t_of_undefined , t_put , t_get , t_map @@ -88,3 +90,12 @@ t_pipe(_Cfg) -> none = hope_option:pipe(Steps, 1), none = hope_option:pipe(Steps, 2), none = hope_option:pipe(Steps, 3). + +t_of_undefined(_Cfg) -> + Foo = foo, + Bar = bar, + Baz = baz, + {some, Foo} = hope_option:of_undefined(Foo), + {some, Bar} = hope_option:of_undefined(Bar), + {some, Baz} = hope_option:of_undefined(Baz), + none = hope_option:of_undefined(undefined).