t/10-vidns.t
changeset 6 271dfe27e1d3
child 7 286a373ab86b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/t/10-vidns.t	Thu May 22 23:31:14 2014 +0200
@@ -0,0 +1,30 @@
+#! perl
+
+use Test::More;
+use strict;
+use warnings;
+
+use_ok 'ViDNS' or BAIL_OUT 'ViDNS not found!';
+#can_ok 'ViDNS', qw(ttl2h h2ttl);
+
+is ttl2h(86400), '1d', '-> 1d';
+is h2ttl('1d'), 86400, '<- 1d';
+
+my $data = do { 
+    local $/ = undef;
+    local @ARGV = 't/kugelbus-axfr';
+    <>;
+};
+
+my @zone1 = parse($data);
+is @zone1, 64 => '64 rrsets';
+
+$data =~ s{^kugelbus.*?IN\s+MX.*?$}{}m;
+my @zone2 = parse($data);
+is @zone2, 63, => '63 rrsets';
+
+my ($add, $del) = delta(\@zone1, \@zone2);
+is @$add, 0 => 'nothing to add';
+is @$del, 1 => '1 set to delete';
+
+done_testing();