tests added

This commit is contained in:
Yakov Olkhovskiy 2023-05-15 03:06:03 +00:00
parent 24067ea977
commit fc857aa2db
2 changed files with 11 additions and 0 deletions

View File

@ -11,6 +11,10 @@ IPv4 functions
127.0.0.1
127.0.0.1
--
1.2.3.4
1.2.3.4
0.0.0.0
--
127.0.0.1
--
0

View File

@ -20,6 +20,13 @@ SELECT toIPv4OrNull('127.0.0.1');
SELECT '--';
SELECT toIPv4(toIPv6('::ffff:1.2.3.4'));
SELECT toIPv4(toIPv6('::afff:1.2.3.4')); --{serverError CANNOT_CONVERT_TYPE}
SELECT toIPv4OrDefault(toIPv6('::ffff:1.2.3.4'));
SELECT toIPv4OrDefault(toIPv6('::afff:1.2.3.4'));
SELECT '--';
SELECT cast('test' , 'IPv4'); --{serverError CANNOT_PARSE_IPV4}
SELECT cast('127.0.0.1' , 'IPv4');