WebService-OPNsense

 view release on metacpan or  search on metacpan

lib/WebService/OPNsense/Constants.pm  view on Meta::CPAN

use Const::Fast qw( const );
use parent      qw( Exporter::Tiny );

# Actions
const our $ACTION_BLOCK  => 'block';
const our $ACTION_PASS   => 'pass';
const our $ACTION_REJECT => 'reject';

# Address families
const our $AF_INET   => 'inet';
const our $AF_INET6  => 'inet6';
const our $AF_INET46 => 'inet46';

# Alias types
const our $ALIAS_ASN           => 'asn';
const our $ALIAS_AUTHGROUP     => 'authgroup';
const our $ALIAS_DYNIPV6HOST   => 'dynipv6host';
const our $ALIAS_EXTERNAL      => 'external';
const our $ALIAS_GEOIP         => 'geoip';
const our $ALIAS_HOST          => 'host';
const our $ALIAS_INTERNAL      => 'internal';

t/010_constants.t  view on Meta::CPAN


## no critic (ValuesAndExpressions::RequireInterpolationOfMetachars)
subtest 'actions' => sub {
    is( $ACTION_BLOCK,  'block',  '$ACTION_BLOCK' );
    is( $ACTION_PASS,   'pass',   '$ACTION_PASS' );
    is( $ACTION_REJECT, 'reject', '$ACTION_REJECT' );
};

subtest 'address families' => sub {
    is( $AF_INET,   'inet',   '$AF_INET' );
    is( $AF_INET6,  'inet6',  '$AF_INET6' );
    is( $AF_INET46, 'inet46', '$AF_INET46' );
};

subtest 'alias types' => sub {
    is( $ALIAS_ASN,           'asn',          '$ALIAS_ASN' );
    is( $ALIAS_AUTHGROUP,     'authgroup',    '$ALIAS_AUTHGROUP' );
    is( $ALIAS_DYNIPV6HOST,   'dynipv6host',  '$ALIAS_DYNIPV6HOST' );
    is( $ALIAS_EXTERNAL,      'external',     '$ALIAS_EXTERNAL' );
    is( $ALIAS_GEOIP,         'geoip',        '$ALIAS_GEOIP' );
    is( $ALIAS_HOST,          'host',         '$ALIAS_HOST' );



( run in 1.395 second using v1.01-cache-2.11-cpan-9581c071862 )