mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Test for negating an aggregation function in a query.
This commit is contained in:
parent
8969baded3
commit
829a8385e8
@ -66,6 +66,8 @@ confirm() ->
|
||||
|
||||
div_aggregate_function_by_zero_test(Conn, Bucket, Where),
|
||||
|
||||
negate_an_aggregation_test(Conn, Bucket, Where),
|
||||
|
||||
pass.
|
||||
|
||||
%%
|
||||
@ -83,3 +85,11 @@ div_aggregate_function_by_zero_test(Conn, Bucket, Where) ->
|
||||
{error,{1001,<<"divide_by_zero">>}},
|
||||
ts_util:single_query(Conn, Query)
|
||||
).
|
||||
|
||||
%%
|
||||
negate_an_aggregation_test(Conn, Bucket, Where) ->
|
||||
Query = "SELECT -COUNT(*), COUNT(*) FROM " ++ Bucket ++ Where,
|
||||
?assertEqual(
|
||||
{[<<"-COUNT(*)">>, <<"COUNT(*)">>],[{-10, 10}]},
|
||||
ts_util:single_query(Conn, Query)
|
||||
).
|
Loading…
Reference in New Issue
Block a user