This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: perl@12605 on VMS, [minor PATCH enclosed]
[perl5.git] / lib / Net / t / nntp.t
CommitLineData
406c51ee
JH
1#!./perl -w
2
3use Net::Config;
4use Net::NNTP;
5use Net::Cmd qw(CMD_REJECT);
6
7unless(@{$NetConfig{nntp_hosts}} && $NetConfig{test_hosts}) {
8 print "1..0\n";
9 exit;
10}
11
12print "1..4\n";
13
14my $i = 1;
15
16$nntp = Net::NNTP->new(Debug => 0)
17 or (print("not ok 1\n"), exit);
18
19print "ok 1\n";
20
21my $grp;
22foreach $grp (qw(test alt.test control news.announce.newusers)) {
23 @grp = $nntp->group($grp);
24 last if @grp;
25}
26
27if($nntp->status == CMD_REJECT) {
28 # Command was rejected, probably because we need authinfo
29 map { print "ok ",$_,"\n" } 2,3,4;
30 exit;
31}
32
33print "not " unless @grp;
34print "ok 2\n";
35
36
37if(@grp && $grp[2] > $grp[1]) {
38 $nntp->head($grp[1]) or print "not ";
39}
40print "ok 3\n";
41
42if(@grp) {
43 $nntp->quit or print "not ";
44}
45print "ok 4\n";
46