Add regex tests for dollar bucket queries
Proce this works as well as for dollar key. This isn't tested in riak_test currently, but seems illogical not to support it her eif it is supported on $key queries.
This commit is contained in:
parent
041e86fed9
commit
37f784f041
1 changed files with 42 additions and 9 deletions
|
@ -598,12 +598,45 @@ dollar_bucket_index(_Config) ->
|
|||
end,
|
||||
FoldAccT = {FoldKeysFun, []},
|
||||
|
||||
{async, Folder} = leveled_bookie:book_keylist(Bookie1, ?RIAK_TAG, <<"Bucket2">>, FoldAccT),
|
||||
ResLen = length(Folder()),
|
||||
{async, Folder} =
|
||||
leveled_bookie:book_keylist(Bookie1,
|
||||
?RIAK_TAG,
|
||||
<<"Bucket2">>,
|
||||
FoldAccT),
|
||||
Results = Folder(),
|
||||
true = 1700 == length(Results),
|
||||
|
||||
io:format("Length of Result of folder ~w~n", [ResLen]),
|
||||
{<<"Bucket2">>, SampleKey} = lists:nth(100, Results),
|
||||
UUID = "[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}",
|
||||
{ok, RESingleMatch} = re:compile(SampleKey),
|
||||
{ok, REAllMatch} = re:compile(UUID),
|
||||
{ok, REMiss} = re:compile("no_key"),
|
||||
|
||||
true = 1700 == ResLen,
|
||||
{async, FolderREMiss} =
|
||||
leveled_bookie:book_keylist(Bookie1,
|
||||
?RIAK_TAG,
|
||||
<<"Bucket2">>,
|
||||
{null, null},
|
||||
{FoldKeysFun, []},
|
||||
REMiss),
|
||||
{async, FolderRESingleMatch} =
|
||||
leveled_bookie:book_keylist(Bookie1,
|
||||
?RIAK_TAG,
|
||||
<<"Bucket2">>,
|
||||
{null, null},
|
||||
{FoldKeysFun, []},
|
||||
RESingleMatch),
|
||||
{async, FolderREAllMatch} =
|
||||
leveled_bookie:book_keylist(Bookie1,
|
||||
?RIAK_TAG,
|
||||
<<"Bucket2">>,
|
||||
{null, null},
|
||||
{FoldKeysFun, []},
|
||||
REAllMatch),
|
||||
|
||||
true = 0 == length(FolderREMiss()),
|
||||
true = 1 == length(FolderRESingleMatch()),
|
||||
true = 1700 == length(FolderREAllMatch()),
|
||||
|
||||
ok = leveled_bookie:book_close(Bookie1),
|
||||
testutil:reset_filestructure().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue