Batch of tests

This commit is contained in:
Alexandr Krasheninnikov 2019-07-10 13:19:14 +03:00
parent 6e224c1ff7
commit eb78c9f084
8 changed files with 59 additions and 0 deletions

View File

@ -12,3 +12,7 @@ SELECT transform(1, [2, 3], ['Яндекс', 'Google'], 'Остальные') AS
SELECT transform(2, [2, 3], ['Яндекс', 'Google'], 'Остальные') AS title;
SELECT transform(3, [2, 3], ['Яндекс', 'Google'], 'Остальные') AS title;
SELECT transform(4, [2, 3], ['Яндекс', 'Google'], 'Остальные') AS title;
SELECT transform('hello', 'wrong', 1); -- { serverError 43 }
SELECT transform('hello', ['wrong'], 1); -- { serverError 43 }
SELECT transform('hello', ['wrong'], [1]); -- { serverError 43 }
SELECT transform(tuple(1), ['sdf'], [1]); -- { serverError 43 }

View File

@ -12,4 +12,6 @@ INSERT INTO endsWith_test values ('11', '22', '33'), ('a', 'a', 'bb'), ('abc', '
SELECT COUNT() FROM endsWith_test WHERE endsWith(S1, S1);
SELECT COUNT() FROM endsWith_test WHERE endsWith(S1, S2);
SELECT COUNT() FROM endsWith_test WHERE endsWith(S2, S3);
SELECT endsWith([], 'str'); -- { serverError 43 }
DROP TABLE endsWith_test;

View File

@ -2,3 +2,6 @@ SELECT timeSlot(toDateTime('2000-01-02 03:04:05', 'UTC'));
SELECT timeSlots(toDateTime('2000-01-02 03:04:05', 'UTC'), toUInt32(10000));
SELECT timeSlots(toDateTime('2000-01-02 03:04:05', 'UTC'), toUInt32(10000), 600);
SELECT timeSlots(toDateTime('2000-01-02 03:04:05', 'UTC'), toUInt32(600), 30);
SELECT timeSlots(toDateTime('2000-01-02 03:04:05', 'UTC'), 'wrong argument'); -- { serverError 43 }
SELECT timeSlots(toDateTime('2000-01-02 03:04:05', 'UTC'), toUInt32(600), 'wrong argument'); -- { serverError 43 }
SELECT timeSlots(toDateTime('2000-01-02 03:04:05', 'UTC'), toUInt32(600), 0); -- { serverError 44 }

View File

@ -0,0 +1,7 @@
0
18
25
35
45
55
55

View File

@ -0,0 +1,7 @@
SELECT roundAge(0);
SELECT roundAge(18);
SELECT roundAge(25);
SELECT roundAge(35);
SELECT roundAge(45);
SELECT roundAge(55);
SELECT roundAge(56);

View File

@ -0,0 +1,16 @@
0
10
30
60
120
180
240
300
600
1200
1800
3600
7200
18000
36000
36000

View File

@ -0,0 +1,16 @@
SELECT roundDuration(0);
SELECT roundDuration(10);
SELECT roundDuration(30);
SELECT roundDuration(60);
SELECT roundDuration(120);
SELECT roundDuration(180);
SELECT roundDuration(240);
SELECT roundDuration(300);
SELECT roundDuration(600);
SELECT roundDuration(1200);
SELECT roundDuration(1800);
SELECT roundDuration(3600);
SELECT roundDuration(7200);
SELECT roundDuration(18000);
SELECT roundDuration(36000);
SELECT roundDuration(37000);

View File

@ -0,0 +1,4 @@
SELECT substring('hello', []); -- { serverError 43 }
SELECT substring('hello', 1, []); -- { serverError 43 }
SELECT substring(materialize('hello'), -1, -1); -- { serverError 69 }
SELECT substring(materialize('hello'), 0); -- { serverError 135 }