File: soattl.t

package info (click to toggle)
libnet-dns-zonefile-fast-perl 1.24-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 256 kB
  • ctags: 40
  • sloc: perl: 1,284; makefile: 2
file content (48 lines) | stat: -rw-r--r-- 885 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This is -*- perl -*-

use IO::File;
use Net::DNS;
use Net::DNS::RR;
use Net::DNS::ZoneFile::Fast;

use Test::More tests => 5;

END {
    unlink "./read.txt";
}

my $zone = q{a.com. 30 IN SOA dns1.a.com. hostmaster.a.com. (1 1 1 1 1)};

ok(defined Net::DNS::ZoneFile::Fast::parse($zone), "parse of the test zone");

my $fh = new IO::File "./read.txt", "w" or die "# Failed to create test file\n";

print $fh $zone;

$fh->close;

$fh = new IO::File "./read.txt" or die "# Failed to open test file\n";

ok(defined Net::DNS::ZoneFile::Fast::parse(fh => $fh), 'readfh');

$fh->close;

ok(defined Net::DNS::ZoneFile::Fast::parse(file => "./read.txt"), 'read');

my $rrset = Net::DNS::ZoneFile::Fast::parse(file => "./read.txt");

ok(defined $rrset, 're-read');

die unless defined $rrset;

my $rr = new Net::DNS::RR $zone;

ok($rr->string eq $rrset->[0]->string, "RR comparison");