Added test.

This commit is contained in:
Nikolai Kochetov 2021-01-14 19:13:14 +03:00
parent 4bb0bd16e1
commit 39de699790
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,18 @@
0
1
\N
\N
2
1
1
1
0
1
2
\N
\N
\N
1
0
1
2

View File

@ -0,0 +1,23 @@
SELECT tupleHammingDistance(tuple(1), tuple(1));
SELECT tupleHammingDistance(tuple(1), tuple(2));
SELECT tupleHammingDistance(tuple(1), tuple(Null));
SELECT tupleHammingDistance(tuple(Null), tuple(Null));
SELECT tupleHammingDistance((1, 2), (3, 4));
SELECT tupleHammingDistance((1, 2), (1, 4));
SELECT tupleHammingDistance(materialize((1, 2)), (1, 4));
SELECT tupleHammingDistance(materialize((1, 2)),materialize ((1, 4)));
SELECT tupleHammingDistance((1, 2), (1, 2));
SELECT tupleHammingDistance((1, 2), (1, 257));
SELECT tupleHammingDistance((1, 2, 3), (1, 257, 65537));
SELECT tupleHammingDistance((1, 2), (1, Null));
SELECT tupleHammingDistance((1, Null), (1, Null));
SELECT tupleHammingDistance((Null, Null), (Null, Null));
SELECT tupleHammingDistance(('abc', 2), ('abc', 257));
SELECT tupleHammingDistance(('abc', (1, 2)), ('abc', (1, 2)));
SELECT tupleHammingDistance(('abc', (1, 2)), ('def', (1, 2)));
SELECT tupleHammingDistance(('abc', (1, 2)), ('def', (1, 3)));
SELECT tupleHammingDistance(tuple(1), tuple(1, 1)); --{serverError 43}
SELECT tupleHammingDistance(tuple(1), tuple('a')); --{serverError 386}
SELECT tupleHammingDistance((1, 3), (3, 'a')); --{serverError 386}