Test for negating an aggregation function in a query.

This commit is contained in:
andytill 2016-03-29 09:35:16 +00:00
parent 8969baded3
commit 829a8385e8

View File

@ -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)
).