1 -module(hope_list_SUITE).
3 -include_lib("proper/include/proper.hrl").
13 [ t_unique_preserve_order/1
20 -define(GROUP , hope_list).
22 -define(PROPTEST(A), true = proper:quickcheck(A())).
25 %% ============================================================================
26 %% Common Test callbacks
27 %% ============================================================================
34 [ t_unique_preserve_order
39 Properties = [parallel],
40 [{?GROUP, Properties, Tests}].
43 %% =============================================================================
45 %% =============================================================================
48 F = fun (N) -> N + 1 end,
49 [4, 3, 2] = hope_list:map_rev([1, 2, 3], F),
50 [] = hope_list:map_rev([], F).
53 F = fun (N) -> N + 1 end,
54 [2, 3, 4] = hope_list:map_slow([1, 2, 3], F),
55 [] = hope_list:map_slow([], F).
57 t_unique_preserve_order(_Cfg) ->
58 ?PROPTEST(prop_unique_preserve_order).
60 prop_unique_preserve_order() ->
63 Duplicates = L -- lists:usort(L),
64 hope_list:unique_preserve_order(L) ==
65 lists:reverse(lists:reverse(L) -- Duplicates)
68 t_hope_list_specs(_) ->
69 [] = proper:check_specs(hope_list).