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
|
@ -3,10 +3,10 @@
|
||||||
-include("include/leveled.hrl").
|
-include("include/leveled.hrl").
|
||||||
-export([all/0]).
|
-export([all/0]).
|
||||||
-export([
|
-export([
|
||||||
crossbucket_aae/1,
|
crossbucket_aae/1,
|
||||||
handoff/1,
|
handoff/1,
|
||||||
dollar_bucket_index/1,
|
dollar_bucket_index/1,
|
||||||
dollar_key_index/1
|
dollar_key_index/1
|
||||||
]).
|
]).
|
||||||
|
|
||||||
all() -> [
|
all() -> [
|
||||||
|
@ -598,12 +598,45 @@ dollar_bucket_index(_Config) ->
|
||||||
end,
|
end,
|
||||||
FoldAccT = {FoldKeysFun, []},
|
FoldAccT = {FoldKeysFun, []},
|
||||||
|
|
||||||
{async, Folder} = leveled_bookie:book_keylist(Bookie1, ?RIAK_TAG, <<"Bucket2">>, FoldAccT),
|
{async, Folder} =
|
||||||
ResLen = length(Folder()),
|
leveled_bookie:book_keylist(Bookie1,
|
||||||
|
?RIAK_TAG,
|
||||||
|
<<"Bucket2">>,
|
||||||
|
FoldAccT),
|
||||||
|
Results = Folder(),
|
||||||
|
true = 1700 == length(Results),
|
||||||
|
|
||||||
|
{<<"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"),
|
||||||
|
|
||||||
io:format("Length of Result of folder ~w~n", [ResLen]),
|
{async, FolderREMiss} =
|
||||||
|
leveled_bookie:book_keylist(Bookie1,
|
||||||
true = 1700 == ResLen,
|
?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),
|
ok = leveled_bookie:book_close(Bookie1),
|
||||||
testutil:reset_filestructure().
|
testutil:reset_filestructure().
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue