diff options
Diffstat (limited to 'test/it.t')
-rwxr-xr-x | test/it.t | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -328,6 +328,20 @@ is(it::cidr_match('2001:918:ff83:101:798e:77c0:b722:fe56', '2001:918:ff83:101::/ is(it::cidr_match('2001:918:ff83:102:798e:77c0:b722:fe56', '2001:918:ff83:101::/64'), false, "cidr_match ipv6 no match" ); is(it::cidr_match('10.11.12.13', ['10.0.0.0/8', '192.168.0.0./16']), true, "cidr_match array"); +# it::is_private_ip tests +is(it::is_private_ip('192.168.2.3'), true, "is_private_ip 192.168/16 example"); +is(it::is_private_ip('34.98.92.95'), false, "is_private_ip search.ch ipv4"); +is(it::is_private_ip('2600:1901:0:6fe0::'), false, "is_private_ip search.ch ipv6"); +is(it::is_private_ip('::1'), true, "is_private_ip loopback ipv6"); +is(it::is_private_ip('172.19.34.19'), true, "is_private_ip 172.16/12 example"); +is(it::is_private_ip('10.128.72.9'), true, "is_private_ip 10/8 example"); +is(it::is_private_ip('195.49.47.11'), false, "is_private_ip gna.ch ipv4"); +is(it::is_private_ip('2a01:2a8:9100:1911:abba:0:1:80'), false, "is_private_ip gna.ch ipv6"); +is(it::is_private_ip('fd12::1337:bab3:d00d'), true, "is_private_ip fc00::/7 example"); +is(it::is_private_ip('81.6.43.252'), false, "is_private_ip dunstkreis.ch ipv4"); +is(it::is_private_ip('2a02:169:200:d::15'), false, "is_private_ip dunstkreis.ch ipv6"); +is(it::is_private_ip('127.6.7.23'), true, "is_private_ip loopback ipv4"); + # it::filter_keys tests $data = ['a' => 1, 'b' => 2, 'c' => 3]; |