Just sorting to guarantee order is not enough.
[p5sagit/p5-mst-13.2.git] / lib / Net / t / hostname.t
CommitLineData
302cc833 1#!./perl -w
2
3BEGIN {
4 unless (-d 'blib') {
5 chdir 't' if -d 't';
6 @INC = '../lib';
7 }
8}
406c51ee 9
10use Net::Domain qw(hostname domainname hostdomain);
11use Net::Config;
12
13unless($NetConfig{test_hosts}) {
14 print "1..0\n";
15 exit 0;
16}
17
0d375cdb 18print "1..2\n";
406c51ee 19
20$domain = domainname();
21
22if(defined $domain && $domain ne "") {
23 print "ok 1\n";
24}
25else {
26 print "not ok 1\n";
27}
0d375cdb 28
29# This check thats hostanme does not overwrite $_
30my @domain = qw(foo.example.com bar.example.jp);
31my @copy = @domain;
32
33my @dummy = grep { hostname eq $_ } @domain;
34
35($domain[0] && $domain[0] eq $copy[0])
36 ? print "ok 2\n"
37 : print "not ok 2\n";