Add tests for hope_kv_list:set/3
[hope.git] / test / hope_kv_list_SUITE.erl
CommitLineData
56b05e81
SK
1-module(hope_kv_list_SUITE).
2
3%% Callbacks
4-export(
5 [ all/0
6 , groups/0
7 ]).
8
9%% Test cases
10-export(
39273fbe
SK
11 [ t_set_new/1
12 , t_set_existing/1
56b05e81
SK
13 ]).
14
15
16-define(GROUP_KV_LIST, kv_list).
17
18
19%% ============================================================================
20%% Common Test callbacks
21%% ============================================================================
22
23all() ->
24 [{group, ?GROUP_KV_LIST}].
25
26groups() ->
27 Tests =
39273fbe
SK
28 [ t_set_new
29 , t_set_existing
56b05e81
SK
30 ],
31 Properties = [],
32 [{?GROUP_KV_LIST, Properties, Tests}].
33
34
35%% =============================================================================
36%% Test cases
37%% =============================================================================
39273fbe
SK
38
39t_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
47t_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.025935 seconds and 4 git commands to generate.