X-Git-Url: https://git.xandkar.net/?p=hope.git;a=blobdiff_plain;f=test%2Fhope_option_SUITE.erl;fp=test%2Fhope_option_SUITE.erl;h=e7d14dcf1aaa35196d7990757b255eac53f6afbc;hp=d2a73a31eda9fdef61c327dfb6955565ecfecc53;hb=5fab324af707977a6e08246757acd09e1a3cb7c1;hpb=4744fed98ce752dde11c03aeaf8d90983efe5ea6 diff --git a/test/hope_option_SUITE.erl b/test/hope_option_SUITE.erl index d2a73a3..e7d14dc 100644 --- a/test/hope_option_SUITE.erl +++ b/test/hope_option_SUITE.erl @@ -9,7 +9,7 @@ %% Test cases -export( [ t_of_result/1 - , t_of_undefined/1 + , t_undefined/1 , t_put/1 , t_get/1 , t_map/1 @@ -33,7 +33,7 @@ all() -> groups() -> Tests = [ t_of_result - , t_of_undefined + , t_undefined , t_put , t_get , t_map @@ -93,14 +93,12 @@ t_pipe(_Cfg) -> 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). +t_undefined(_Cfg) -> + X = foo, + {some, X} = hope_option:of_undefined(X), + X = hope_option:to_undefined({some, X}), + none = hope_option:of_undefined(undefined), + undefined = hope_option:to_undefined(none). t_validate(_Cfg) -> IsFoo = fun (X) -> X =:= foo end,