xref: /openbsd-src/gnu/usr.bin/perl/cpan/libnet/t/smtp.t (revision de8cc8edbc71bd3e3bc7fbffa27ba0e564c37d8b)
1#!perl
2
3use 5.008001;
4
5use strict;
6use warnings;
7
8BEGIN {
9    if (!eval { require Socket }) {
10        print "1..0 # no Socket\n"; exit 0;
11    }
12    if (ord('A') == 193 && eval { require Convert::EBCDIC }) {
13        print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
14    }
15}
16
17use Net::Config;
18use Net::SMTP;
19
20unless(@{$NetConfig{smtp_hosts}} && $NetConfig{test_hosts}) {
21    print "1..0\n";
22    exit 0;
23}
24
25print "1..3\n";
26
27my $i = 1;
28
29my $smtp = Net::SMTP->new(Debug => 0)
30        or (print("not ok 1\n"), exit);
31
32print "ok 1\n";
33
34$smtp->domain or print "not ";
35print "ok 2\n";
36
37$smtp->quit or print "not ";
38print "ok 3\n";
39
40