File: 06-suffix-without-root.t

package info (click to toggle)
libdomain-publicsuffix-perl 0.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 536 kB
  • sloc: perl: 14,272; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 515 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Domain::PublicSuffix;

ok( my $dps = Domain::PublicSuffix->new({
	'use_default'             => 1,
	'domain_allow_underscore' => 1,
}) );

is( $dps->get_root_domain('m.com.ac'), 'm.com.ac', 'm.com.ac valid' );
is( $dps->suffix(), 'com.ac', 'm.com.ac -> com.ac');
is( $dps->get_root_domain('com.ac'), undef, 'com.ac invalid' );
is( $dps->suffix(), 'com.ac', 'suffix com.ac -> com.ac');
is( $dps->tld(), 'ac', 'tld com.ac -> ac');

done_testing();

1;