Commit 69273c8f authored by Peter Eisentraut's avatar Peter Eisentraut

Add test case for abbrev(cidr)

This will in particular add some good test coverage for
inet_cidr_ntop.c, which was previously completely uncovered.
Reviewed-by: default avatarTom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/cb0c4662-4596-dab4-7f64-839c5e8582c8%40enterprisedb.com
parent e7f42914
......@@ -88,6 +88,28 @@ SELECT i AS inet, host(i), text(i), family(i) FROM INET_TBL;
::4.3.2.1/24 | ::4.3.2.1 | ::4.3.2.1/24 | 6
(17 rows)
SELECT c AS cidr, abbrev(c) FROM INET_TBL;
cidr | abbrev
--------------------+--------------------
192.168.1.0/24 | 192.168.1/24
192.168.1.0/26 | 192.168.1.0/26
192.168.1.0/24 | 192.168.1/24
192.168.1.0/24 | 192.168.1/24
192.168.1.0/24 | 192.168.1/24
192.168.1.0/24 | 192.168.1/24
10.0.0.0/8 | 10/8
10.0.0.0/32 | 10.0.0.0/32
10.1.2.3/32 | 10.1.2.3/32
10.1.2.0/24 | 10.1.2/24
10.1.0.0/16 | 10.1/16
10.0.0.0/8 | 10/8
10.0.0.0/8 | 10/8
10.0.0.0/8 | 10/8
10:23::f1/128 | 10:23::f1/128
10:23::8000/113 | 10:23::8000/113
::ffff:1.2.3.4/128 | ::ffff:1.2.3.4/128
(17 rows)
SELECT c AS cidr, broadcast(c),
i AS inet, broadcast(i) FROM INET_TBL;
cidr | broadcast | inet | broadcast
......
......@@ -34,6 +34,7 @@ SELECT c AS cidr, i AS inet FROM INET_TBL;
-- now test some support functions
SELECT i AS inet, host(i), text(i), family(i) FROM INET_TBL;
SELECT c AS cidr, abbrev(c) FROM INET_TBL;
SELECT c AS cidr, broadcast(c),
i AS inet, broadcast(i) FROM INET_TBL;
SELECT c AS cidr, network(c) AS "network(cidr)",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment