Additional unit test
Need to test scenario where the key list the SST file created from is an exact multiple of the slot size
This commit is contained in:
parent
431c2cee40
commit
5c662aeca1
1 changed files with 18 additions and 1 deletions
|
@ -1657,6 +1657,23 @@ additional_range_test() ->
|
||||||
% ?assertMatch([], R8).
|
% ?assertMatch([], R8).
|
||||||
|
|
||||||
|
|
||||||
|
simple_persisted_slotsize_test() ->
|
||||||
|
{RP, Filename} = {"../test/", "simple_slotsize_test"},
|
||||||
|
KVList0 = generate_randomkeys(1, ?SLOT_SIZE * 2, 1, 20),
|
||||||
|
KVList1 = lists:sublist(lists:ukeysort(1, KVList0), ?SLOT_SIZE),
|
||||||
|
[{FirstKey, _FV}|_Rest] = KVList1,
|
||||||
|
{LastKey, _LV} = lists:last(KVList1),
|
||||||
|
{ok, Pid, {FirstKey, LastKey}} = sst_new(RP,
|
||||||
|
Filename,
|
||||||
|
1,
|
||||||
|
KVList1,
|
||||||
|
length(KVList1)),
|
||||||
|
lists:foreach(fun({K, V}) ->
|
||||||
|
?assertMatch({K, V}, sst_get(Pid, K))
|
||||||
|
end,
|
||||||
|
KVList1),
|
||||||
|
ok = sst_close(Pid),
|
||||||
|
ok = file:delete(filename:join(RP, Filename ++ ".sst")).
|
||||||
|
|
||||||
simple_persisted_test() ->
|
simple_persisted_test() ->
|
||||||
{RP, Filename} = {"../test/", "simple_test"},
|
{RP, Filename} = {"../test/", "simple_test"},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue