mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 16:45:29 +00:00
Match results of the selection, from ok to {Cols, Rows}.
This commit is contained in:
parent
c21666c423
commit
650ab6a44e
@ -149,6 +149,21 @@ get_valid_select_data() ->
|
||||
Times = lists:seq(1, 10),
|
||||
[[Family, Series, X, get_varchar(), get_float()] || X <- Times].
|
||||
|
||||
get_cols(docs) ->
|
||||
[<<"myfamily">>,
|
||||
<<"myseries">>,
|
||||
<<"time">>,
|
||||
<<"weather">>,
|
||||
<<"temperature">>].
|
||||
|
||||
%% Convert put data to result rows exclusive of the first and last records.
|
||||
exclusive_result_from_data(Data) ->
|
||||
[_|Tail] = remove_last([list_to_tuple(R) || R <- Data]),
|
||||
Tail.
|
||||
|
||||
remove_last(Data) ->
|
||||
lists:reverse(tl(lists:reverse(Data))).
|
||||
|
||||
%% a valid DDL - the one used in the documents
|
||||
get_ddl(docs) ->
|
||||
_SQL = "CREATE TABLE GeoCheckin (" ++
|
||||
|
@ -14,21 +14,13 @@
|
||||
]).
|
||||
|
||||
confirm() ->
|
||||
Cluster = single,
|
||||
TestType = normal,
|
||||
DDL = get_ddl(docs),
|
||||
Data = get_valid_select_data(),
|
||||
Qry = get_valid_qry(),
|
||||
confirm_select(single, normal, DDL, Data, Qry, {get_cols(docs), to_result(Data)}).
|
||||
Expected = {
|
||||
timeseries_util:get_cols(docs),
|
||||
timeseries_util:exclusive_result_from_data(Data)},
|
||||
confirm_select(Cluster, TestType, DDL, Data, Qry, Expected).
|
||||
|
||||
get_cols(docs) ->
|
||||
[<<"myfamily">>,
|
||||
<<"myseries">>,
|
||||
<<"time">>,
|
||||
<<"weather">>,
|
||||
<<"temperature">>].
|
||||
|
||||
to_result(Data) ->
|
||||
[_|Tail] = remove_last([list_to_tuple(R) || R <- Data]),
|
||||
Tail .
|
||||
|
||||
remove_last(Data) ->
|
||||
lists:reverse(tl(lists:reverse(Data))).
|
@ -14,8 +14,12 @@
|
||||
]).
|
||||
|
||||
confirm() ->
|
||||
Cluster = multiple,
|
||||
TestType = normal,
|
||||
DDL = get_ddl(docs),
|
||||
Data = get_valid_select_data(),
|
||||
Qry = get_valid_qry(),
|
||||
Expected = ok,
|
||||
confirm_select(multiple, normal, DDL, Data, Qry, Expected).
|
||||
Expected = {
|
||||
timeseries_util:get_cols(docs),
|
||||
timeseries_util:exclusive_result_from_data(Data)},
|
||||
confirm_select(Cluster, TestType, DDL, Data, Qry, Expected).
|
||||
|
Loading…
Reference in New Issue
Block a user