From 8dad2fafa947042d0f63de1c6c9da999490b1c89 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 14 Aug 2014 22:54:13 -0400 Subject: [PATCH] Test hope_list:unique_preserve_order/1 --- test/hope_list_SUITE.erl | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/hope_list_SUITE.erl 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. -- 2.20.1