added tests for hasAll and hasAny [#CLICKHOUSE-3504]

This commit is contained in:
Nikolai Kochetov 2018-01-10 21:57:25 +03:00
parent 8ceb85bcca
commit f0f6343a39
2 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,45 @@
1
0
0
1
0
1
0
1
-
0
0
0
1
1
0
0
1
-
1
0
-
0
1
1
1
0
1
0
1
0
-
1
1
1
0
-
0
0
0
0
-
0
1
1
0

View File

@ -0,0 +1,52 @@
select hasAll([], []);
select hasAll([], [1]);
select hasAll([], [NULL]);
select hasAll([Null], [Null]);
select hasAll([Null], [Null, 1]);
select hasAll([1], []);
select hasAll([1], [Null]);
select hasAll([1, Null], [Null]);
select '-';
select hasAny([], []);
select hasAny([], [1]);
select hasAny([], [NULL]);
select hasAny([Null], [Null]);
select hasAny([Null], [Null, 1]);
select hasAny([1], []);
select hasAny([1], [Null]);
select hasAny([1, Null], [Null]);
select '-';
select hasAll([1], emptyArrayUInt8());
select hasAny([1], emptyArrayUInt8());
select '-';
select hasAny([1, 2, 3, 4], [5, 6]);
select hasAny([1, 2, 3, 4], [1, 3, 5]);
select hasAny([1, 2, 3, 4], [1, 3]);
select hasAll([1, 2, 3, 4], [1, 3]);
select hasAll([1, 2, 3, 4], [1, 3, 5]);
select hasAny([-128, 1., 512], [1.]);
select hasAny([-128, 1.0, 512], [.3]);
select hasAll([-128, 1.0, 512], [1.0]);
select hasAll([-128, 1.0, 512], [1.0, 513]);
select '-';
select hasAny(['a'], ['a']);
select hasAll(['a'], ['a']);
select hasAny(['a', 'b'], ['a', 'c']);
select hasAll(['a', 'b'], ['a', 'c']);
select '-';
select hasAny([1], ['a']);
select hasAll([1], ['a']);
select hasAll([[1, 2], [3, 4]], ['a', 'c']);
select hasAny([[1, 2], [3, 4]], ['a', 'c']);
select '-';
select hasAll([[1, 2], [3, 4]], [[1, 2], [3, 5]]);
select hasAll([[1, 2], [3, 4]], [[1, 2], [1, 2]]);
select hasAny([[1, 2], [3, 4]], [[1, 2], [3, 5]]);
select hasAny([[1, 2], [3, 4]], [[1, 3], [4, 2]]);