t/10-minimal.t
changeset 9 b2a26d05b063
parent 5 2e27cfdf85ea
child 10 4243e22505f9
--- a/t/10-minimal.t	Tue Dec 30 23:27:37 2014 +0100
+++ b/t/10-minimal.t	Tue Jan 06 13:35:59 2015 +0100
@@ -1,3 +1,4 @@
+#! perl
 use 5.014;
 use strict;
 use warnings;
@@ -23,7 +24,33 @@
 require_ok 'blib/nagios/plugins/ius/check_dns-serial'
   or BAIL_OUT q{can't require the module};
 
-is_deeply [sort +uniq(qw(a b a c))], [qw(a b c)] => 'uniq helper';
+
+subtest 'tools' => sub {
+    is_deeply [sort +uniq(qw(a b a c))], [qw(a b c)] => 'uniq helper';
+
+    my %google = ( nameservers => [qw/8.8.8.8 8.8.4.4/]);
+    my %level3 = ( nameservers => [qw/209.244.0.3 209.244.0.4/]);
+
+    my $r1a = Net::DNS::Resolver->new(%google);
+    my $r1b = Net::DNS::Resolver->new(%google);
+
+    my $r2a = Net::DNS::Resolver->new(%level3);
+    my $r2b = Net::DNS::Resolver->new(%level3);
+
+    is $r1a, $r1b => 'same google';
+    is $r2a, $r2b => 'same level3';
+    isnt $r1a, $r2a => 'not same google/level3';
+
+    my @a;
+    @a = qw[8.8.8.8];
+    my $r3a = Net::DNS::Resolver->new(nameservers => \@a);
+    @a = qw[8.8.4.4];
+    my $r3b = Net::DNS::Resolver->new(nameservers => \@a);
+
+    isnt $r3a, $r3b => 'same ref, but not same object';
+
+};
+
 
 # get_domains should read a list of names, either from a file
 # or from the arguments, or from a combination of both
@@ -60,3 +87,5 @@
 # serial
 
 done_testing();
+
+# vim:sts=4 sw=4 ts=8: