Integrate mainline (mostly) utf8.c does not compile.
[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 }
1a8dcddb 8 if (!eval "require Socket") {
9 print "1..0 # no Socket\n"; exit 0;
10 }
8b14f033 11 if (ord('A') == 193 && !eval "require Convert::EBCDIC") {
12 print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
13 }
302cc833 14}
406c51ee 15
16use Net::Domain qw(hostname domainname hostdomain);
17use Net::Config;
18
19unless($NetConfig{test_hosts}) {
20 print "1..0\n";
21 exit 0;
22}
23
0d375cdb 24print "1..2\n";
406c51ee 25
26$domain = domainname();
27
28if(defined $domain && $domain ne "") {
29 print "ok 1\n";
30}
31else {
32 print "not ok 1\n";
33}
0d375cdb 34
35# This check thats hostanme does not overwrite $_
36my @domain = qw(foo.example.com bar.example.jp);
37my @copy = @domain;
38
39my @dummy = grep { hostname eq $_ } @domain;
40
41($domain[0] && $domain[0] eq $copy[0])
42 ? print "ok 2\n"
43 : print "not ok 2\n";