1 -module(hope_list_SUITE).
3 -include_lib("proper/include/proper.hrl").
13 [ t_unique_preserve_order/1
21 -define(GROUP , hope_list).
23 -define(PROPTEST(A), true = proper:quickcheck(A())).
26 %% ============================================================================
27 %% Common Test callbacks
28 %% ============================================================================
35 [ t_unique_preserve_order
41 Properties = [parallel],
42 [{?GROUP, Properties, Tests}].
45 %% =============================================================================
47 %% =============================================================================
53 ?FORALL({L, F}, {list(integer()), function([integer()], term())},
54 hope_list:map_rev(L, F) == lists:reverse(lists:map(F, L))).
60 ?FORALL({L, F}, {list(integer()), function([integer()], term())},
61 hope_list:map_slow(L, F) == lists:map(F, L)).
67 ?FORALL({L, F}, {list(integer()), function([integer()], term())},
68 hope_list:map(L, F) == lists:map(F, L)).
70 t_unique_preserve_order(_Cfg) ->
71 ?PROPTEST(prop_unique_preserve_order).
73 prop_unique_preserve_order() ->
76 Duplicates = L -- lists:usort(L),
77 hope_list:unique_preserve_order(L) ==
78 lists:reverse(lists:reverse(L) -- Duplicates)
81 t_hope_list_specs(_) ->
82 [] = proper:check_specs(hope_list).