1 -module(hope_kv_list_SUITE).
17 -define(GROUP_KV_LIST, kv_list).
20 %% ============================================================================
21 %% Common Test callbacks
22 %% ============================================================================
24 %% TODO: Make tests generic for any dictionary.
25 %% TODO: Each group should test a type of dictionary against the generic cases.
28 [{group, ?GROUP_KV_LIST}].
37 [{?GROUP_KV_LIST, Properties, Tests}].
40 %% =============================================================================
42 %% =============================================================================
47 ListInitial = hope_kv_list:empty(),
48 ListResulting = hope_kv_list:set(ListInitial, Key, ValExpected),
49 {some, ValResulting} = hope_kv_list:get(ListResulting, Key),
50 ValResulting = ValExpected.
52 t_set_existing(_Config) ->
56 ListInitial = [{donald, duck}, {Key, ValInitial}],
57 ListResulting = hope_kv_list:set(ListInitial, Key, ValExpected),
58 {some, ValResulting} = hope_kv_list:get(ListResulting, Key),
59 ValResulting = ValExpected.
62 KVList = [{a, 1}, {b, 2}, {c, 3}],
63 Dict1 = hope_kv_list:of_kv_list(KVList),
64 {{some, 1}, Dict2} = hope_kv_list:pop(Dict1, a),
65 {none , _Dict3} = hope_kv_list:pop(Dict2, a).