From: Siraaj Khandkar Date: Fri, 15 Aug 2014 02:54:13 +0000 (-0400) Subject: Test hope_list:unique_preserve_order/1 X-Git-Tag: 1.0.0~7 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=8dad2fafa947042d0f63de1c6c9da999490b1c89;p=hope.git Test hope_list:unique_preserve_order/1 --- diff --git a/test/hope_list_SUITE.erl b/test/hope_list_SUITE.erl new file mode 100644 index 0000000..751157d --- /dev/null +++ b/test/hope_list_SUITE.erl @@ -0,0 +1,45 @@ +-module(hope_list_SUITE). + +%% Callbacks +-export( + [ all/0 + , groups/0 + ]). + +%% Test cases +-export( + [ t_unique_preserve_order/1 + ]). + + +-define(GROUP , hope_list). + + +%% ============================================================================ +%% Common Test callbacks +%% ============================================================================ + +all() -> + [{group, ?GROUP}]. + +groups() -> + Tests = + [ t_unique_preserve_order + ], + Properties = [], + [{?GROUP, Properties, Tests}]. + + +%% ============================================================================= +%% Test cases +%% ============================================================================= + +t_unique_preserve_order(_Cfg) -> + ListAGiven = [a, a, g, b, f, c, a, d, a, e, f, d], + ListBGiven = "australia", + ListAExpected = [a, g, b, f, c, d, e], + ListBExpected = "austrli", + ListAComputed = hope_list:unique_preserve_order(ListAGiven), + ListBComputed = hope_list:unique_preserve_order(ListBGiven), + ListAComputed = ListAExpected, + ListBComputed = ListBExpected.