Fix unit tests - and make slot size configurable
This commit is contained in:
parent
f907fb5c97
commit
ae9b03ab3c
6 changed files with 76 additions and 46 deletions
|
@ -1431,22 +1431,26 @@ compact_journal_testto(WRP, ExpectedFiles) ->
|
|||
ActualManifest = ink_getmanifest(Ink1),
|
||||
ok = ink_printmanifest(Ink1),
|
||||
?assertMatch(3, length(ActualManifest)),
|
||||
ok = ink_compactjournal(Ink1,
|
||||
Checker,
|
||||
fun(X) -> {X, 55} end,
|
||||
fun(_F) -> ok end,
|
||||
fun(L, K, SQN) -> lists:member({SQN, K}, L) end,
|
||||
5000),
|
||||
{ok, _ICL1} = ink_compactjournal(Ink1,
|
||||
Checker,
|
||||
fun(X) -> {X, 55} end,
|
||||
fun(_F) -> ok end,
|
||||
fun(L, K, SQN) ->
|
||||
lists:member({SQN, K}, L)
|
||||
end,
|
||||
5000),
|
||||
timer:sleep(1000),
|
||||
CompactedManifest1 = ink_getmanifest(Ink1),
|
||||
?assertMatch(2, length(CompactedManifest1)),
|
||||
Checker2 = lists:sublist(Checker, 16),
|
||||
ok = ink_compactjournal(Ink1,
|
||||
Checker2,
|
||||
fun(X) -> {X, 55} end,
|
||||
fun(_F) -> ok end,
|
||||
fun(L, K, SQN) -> lists:member({SQN, K}, L) end,
|
||||
5000),
|
||||
{ok, _ICL2} = ink_compactjournal(Ink1,
|
||||
Checker2,
|
||||
fun(X) -> {X, 55} end,
|
||||
fun(_F) -> ok end,
|
||||
fun(L, K, SQN) ->
|
||||
lists:member({SQN, K}, L)
|
||||
end,
|
||||
5000),
|
||||
timer:sleep(1000),
|
||||
CompactedManifest2 = ink_getmanifest(Ink1),
|
||||
{ok, PrefixTest} = re:compile(?COMPACT_FP),
|
||||
|
@ -1475,12 +1479,12 @@ empty_manifest_test() ->
|
|||
|
||||
CheckFun = fun(L, K, SQN) -> lists:member({SQN, key_converter(K)}, L) end,
|
||||
?assertMatch(false, CheckFun([], "key", 1)),
|
||||
ok = ink_compactjournal(Ink1,
|
||||
[],
|
||||
fun(X) -> {X, 55} end,
|
||||
fun(_F) -> ok end,
|
||||
CheckFun,
|
||||
5000),
|
||||
{ok, _ICL1} = ink_compactjournal(Ink1,
|
||||
[],
|
||||
fun(X) -> {X, 55} end,
|
||||
fun(_F) -> ok end,
|
||||
CheckFun,
|
||||
5000),
|
||||
timer:sleep(1000),
|
||||
?assertMatch(1, length(ink_getmanifest(Ink1))),
|
||||
ok = ink_close(Ink1),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue