32 subtest 'tools' => sub { |
32 subtest 'tools' => sub { |
33 is_deeply [sort +uniq(qw(a b a c))], [qw(a b c)] => 'uniq helper'; |
33 is_deeply [sort +uniq(qw(a b a c))], [qw(a b c)] => 'uniq helper'; |
34 |
34 |
35 # get_domains should read a list of names, either from a file |
35 # get_domains should read a list of names, either from a file |
36 # or from the arguments, or from a combination of both |
36 # or from the arguments, or from a combination of both |
37 is_deeply [get_domains(qw(a b c))], [qw(a b c)] => 'domains from list'; |
37 is_deeply [get_domains(sources => [qw/a b c/])], [qw(a b c)] => 'domains from list'; |
38 is_deeply [get_domains("$tmp")], [qw(a b c d)] => 'domains from file'; |
38 is_deeply [get_domains(sources => ["$tmp"])], [qw(a b c d)] => 'domains from file'; |
39 is_deeply [get_domains('a', "$tmp", 'z')], |
39 is_deeply [get_domains(sources => ['a', "$tmp", 'z'])], [qw(a a b c d z)] => 'domains from args and file'; |
40 [qw(a a b c d z)] => 'domains from args and file'; |
|
41 |
40 |
42 is_deeply {read_override("$tmp")}, { c => ['ns1', 'ns2'] }, 'override file'; |
41 is_deeply {read_override("$tmp")}, { c => ['ns1', 'ns2'] }, 'override file'; |
43 |
42 |
44 my %google = ( nameservers => [qw/8.8.8.8 8.8.4.4/]); |
43 my %google = ( nameservers => [qw/8.8.8.8 8.8.4.4/]); |
45 my %level3 = ( nameservers => [qw/209.244.0.3 209.244.0.4/]); |
44 my %level3 = ( nameservers => [qw/209.244.0.3 209.244.0.4/]); |