Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiget test #44

Merged
merged 2 commits into from
Oct 16, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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