1 -module(hope_list_SUITE).
3 -include_lib("proper/include/proper.hrl").
13 [ t_unique_preserve_order/1
22 -define(GROUP , hope_list).
24 -define(PROPTEST(A), true = proper:quickcheck(A())).
27 %% ============================================================================
28 %% Common Test callbacks
29 %% ============================================================================
36 [ t_unique_preserve_order
43 Properties = [parallel],
44 [{?GROUP, Properties, Tests}].
47 %% =============================================================================
49 %% =============================================================================
55 ?FORALL({L, F}, {list(integer()), function([integer()], term())},
56 hope_list:map_rev(L, F) == lists:reverse(lists:map(F, L))).
62 ?FORALL({L, F}, {list(integer()), function([integer()], term())},
63 hope_list:map_slow(L, F) == lists:map(F, L)).
69 ?FORALL({L, F}, {list(integer()), function([integer()], term())},
70 hope_list:map(L, F) == lists:map(F, L)).
76 ?FORALL({L, F, N}, {list(integer()), function([integer()], term()), non_neg_integer()},
77 hope_list:map(L, F, N) == lists:map(F, L)).
79 t_unique_preserve_order(_Cfg) ->
80 ?PROPTEST(prop_unique_preserve_order).
82 prop_unique_preserve_order() ->
85 Duplicates = L -- lists:usort(L),
86 hope_list:unique_preserve_order(L) ==
87 lists:reverse(lists:reverse(L) -- Duplicates)
90 t_hope_list_specs(_) ->
91 [] = proper:check_specs(hope_list).