File: max_hosts.sql

package info (click to toggle)
pg-gvm 22.6.11-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 416 kB
  • sloc: ansic: 574; sql: 201; sh: 30; makefile: 12
file content (14 lines) | stat: -rw-r--r-- 507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Start transaction and plan the tests.
BEGIN;

-- IMPORTANT! See https://pgtap.org/documentation.html#iloveitwhenaplancomestogether
SELECT plan(2);

-- Run the tests.
-- Test with empty input
SELECT is(max_hosts('192.168.123.1-192.168.123.20, 192.168.123.30-192.168.123.34', ''), 25, 'Value should be 25');
SELECT is(max_hosts('192.168.123.1-192.168.123.20, 192.168.123.30-192.168.123.34', '192.168.123.10'), 24, 'Value should be 24');

-- Finish the tests and clean up.
SELECT * FROM finish();
ROLLBACK;