basic fail tests now pass

This commit is contained in:
Gordon Guthrie 2016-01-05 16:48:53 +00:00
parent 8eb43acb38
commit 428fdd6e48

View File

@ -36,21 +36,26 @@ confirm() ->
Qry = "SELECT SUM(mybool) FROM " ++ Bucket, Qry = "SELECT SUM(mybool) FROM " ++ Bucket,
ClusterConn = {_Cluster, Conn} = ts_util:cluster_and_connect(single), ClusterConn = {_Cluster, Conn} = ts_util:cluster_and_connect(single),
Got = ts_util:ts_query(ClusterConn, TestType, DDL, Data, Qry, Bucket), Got = ts_util:ts_query(ClusterConn, TestType, DDL, Data, Qry, Bucket),
?assertEqual(some_error_value, Got), ?assertEqual({error, {1001, <<"invalid_query: \nFunction 'SUM'/1 called with arguments of the wrong type [boolean].">>}}, Got),
Qry2 = "SELECT AVG(myfamily) FROM " ++ Bucket, Qry2 = "SELECT AVG(myfamily) FROM " ++ Bucket,
Got2 = ts_util:single_query(Conn, Qry2), Got2 = ts_util:single_query(Conn, Qry2),
?assertEqual(some_error_value, Got2), ?assertEqual({error, {1001, <<"invalid_query: \nFunction 'AVG'/1 called with arguments of the wrong type [varchar].">>}}, Got2),
Qry3 = "SELECT MIN(myseries) FROM " ++ Bucket, Qry3 = "SELECT MIN(myseries) FROM " ++ Bucket,
Got3 = ts_util:single_query(Conn, Qry3), Got3 = ts_util:single_query(Conn, Qry3),
?assertEqual(some_error_value, Got3), ?assertEqual({error, {1001, <<"invalid_query: \nFunction 'MIN'/1 called with arguments of the wrong type [varchar].">>}}, Got3),
Qry4 = "SELECT MAX(mytimestamp) FROM " ++ Bucket, Qry4 = "SELECT MAX(myseries) FROM " ++ Bucket,
Got4 = ts_util:single_query(Conn, Qry4), Got4 = ts_util:single_query(Conn, Qry4),
?assertEqual(some_error_value, Got4), ?assertEqual({error, {1001, <<"invalid_query: \nFunction 'MAX'/1 called with arguments of the wrong type [varchar].">>}}, Got4),
Qry5 = "SELECT STDDEV(mybool) FROM " ++ Bucket, Qry5 = "SELECT STDEV(mybool) FROM " ++ Bucket,
Got5 = ts_util:single_query(Conn, Qry5), Got5 = ts_util:single_query(Conn, Qry5),
?assertEqual(some_error_value, Got5), ?assertEqual({error, {1001, <<"invalid_query: \nFunction 'STDEV'/1 called with arguments of the wrong type [boolean].">>}}, Got5),
Qry6 = "SELECT Mean(mybool) FROM " ++ Bucket,
Got6 = ts_util:single_query(Conn, Qry6),
?assertEqual({error, {1001, <<"invalid_query: \nFunction 'MEAN'/1 called with arguments of the wrong type [boolean].">>}}, Got6),
pass. pass.