Skip to content

Commit

Permalink
Merge pull request #44 from sideshowcoder/add_multiget_test
Browse files Browse the repository at this point in the history
Add multiget test
  • Loading branch information
soup-in-boots committed Oct 16, 2014
2 parents 9334317 + 23bb22d commit 8e08d3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/cberl_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cberl_test_() ->
[{foreach, fun setup/0, fun clean_up/1,
[fun test_set_and_get/1,
fun test_replace_add/1,
fun test_multi_get/1,
fun test_get_and_touch/1,
fun test_append_prepend/1,
fun test_remove/1,
Expand Down Expand Up @@ -47,6 +48,12 @@ test_set_and_get(_) ->
?_assertMatch({Key, _, Value}, Get3)
].

test_multi_get(_) ->
Value = "testval",
Keys = lists:map(fun(N) -> list_to_binary(integer_to_list(N)) end, lists:seq(1, 1000)),
lists:map(fun(Key) -> ok = cberl:set(?POOLNAME, Key, 0, Value) end, Keys),
[?_assertMatch({<<"1">>,_, "testval"}, lists:nth(1, cberl:mget(?POOLNAME, Keys)))].

test_replace_add(_) ->
Key = <<"testkey">>,
Value = "testval",
Expand Down

0 comments on commit 8e08d3f

Please sign in to comment.