File: origin.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 (31 lines) | stat: -rw-r--r-- 1,171 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
# This is -*- perl -*-

use Net::DNS::ZoneFile::Fast;
use Test::More tests => 9;

ok(defined Net::DNS::ZoneFile::Fast::parse(q{}), 
   'Empty zone');

ok(defined Net::DNS::ZoneFile::Fast::parse(q{$ORIGIN acme.com.}), 
   'Simple $ORIGIN clause');

ok(defined Net::DNS::ZoneFile::Fast::parse(q{$ORIGIN acme.com. ; comment}), 
   'Simple $ORIGIN clause with comments');

ok(defined Net::DNS::ZoneFile::Fast::parse(q{$ORIGIN acme.com}), 
   'Simple $ORIGIN clause with no trailing dot');

ok(defined Net::DNS::ZoneFile::Fast::parse(q{$ORIGIN acme.com ; comment}), 
   'Simple $ORIGIN clause with comments and no dot');

ok(defined Net::DNS::ZoneFile::Fast::parse(q{$ORIGIN . ; comment}), 
   'Simple $ORIGIN clause with comments and just a dot');

ok(defined Net::DNS::ZoneFile::Fast::parse(q{$ORIGIN .}), 
   'Simple $ORIGIN clause with just a dot');

ok(!defined Net::DNS::ZoneFile::Fast::parse(text => q{$ORIGIN}, quiet => 1, soft_errors => 1),
   '$ORIGIN token alone in the file');

my $rr = Net::DNS::ZoneFile::Fast::parse("\$ORIGIN bork.\n\$ORIGIN moo.bla\nmoof  A 1.2.3.4");
ok(defined($rr) && 1 == @$rr && $rr->[0]->name eq "moof.moo.bla.bork", 'Relative origin');