98c5489e2a625fabffd94ea53d57ce926e403fab
[hope.git] / test / hope_kv_list_SUITE.erl
1 -module(hope_kv_list_SUITE).
2
3 %% Callbacks
4 -export(
5 [ all/0
6 , groups/0
7 ]).
8
9 %% Test cases
10 -export(
11 [ t_set_new/1
12 , t_set_existing/1
13 ]).
14
15
16 -define(GROUP_KV_LIST, kv_list).
17
18
19 %% ============================================================================
20 %% Common Test callbacks
21 %% ============================================================================
22
23 all() ->
24 [{group, ?GROUP_KV_LIST}].
25
26 groups() ->
27 Tests =
28 [ t_set_new
29 , t_set_existing
30 ],
31 Properties = [],
32 [{?GROUP_KV_LIST, Properties, Tests}].
33
34
35 %% =============================================================================
36 %% Test cases
37 %% =============================================================================
38
39 t_set_new(_Config) ->
40 Key = key,
41 ValExpected = bar,
42 ListInitial = hope_kv_list:empty(),
43 ListResulting = hope_kv_list:set(ListInitial, Key, ValExpected),
44 {some, ValResulting} = hope_kv_list:get(ListResulting, Key),
45 ValResulting = ValExpected.
46
47 t_set_existing(_Config) ->
48 Key = key,
49 ValInitial = foo,
50 ValExpected = bar,
51 ListInitial = [{donald, duck}, {Key, ValInitial}],
52 ListResulting = hope_kv_list:set(ListInitial, Key, ValExpected),
53 {some, ValResulting} = hope_kv_list:get(ListResulting, Key),
54 ValResulting = ValExpected.
This page took 0.041472 seconds and 3 git commands to generate.