& what's to be done for 5.8.0?
[p5sagit/p5-mst-13.2.git] / lib / Net / t / nntp.t
CommitLineData
406c51ee 1#!./perl -w
2
88587957 3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6}
7
406c51ee 8use Net::Config;
9use Net::NNTP;
10use Net::Cmd qw(CMD_REJECT);
11
12unless(@{$NetConfig{nntp_hosts}} && $NetConfig{test_hosts}) {
13 print "1..0\n";
14 exit;
15}
16
17print "1..4\n";
18
19my $i = 1;
20
21$nntp = Net::NNTP->new(Debug => 0)
22 or (print("not ok 1\n"), exit);
23
24print "ok 1\n";
25
26my $grp;
27foreach $grp (qw(test alt.test control news.announce.newusers)) {
28 @grp = $nntp->group($grp);
29 last if @grp;
30}
31
32if($nntp->status == CMD_REJECT) {
33 # Command was rejected, probably because we need authinfo
34 map { print "ok ",$_,"\n" } 2,3,4;
35 exit;
36}
37
38print "not " unless @grp;
39print "ok 2\n";
40
41
42if(@grp && $grp[2] > $grp[1]) {
43 $nntp->head($grp[1]) or print "not ";
44}
45print "ok 3\n";
46
47if(@grp) {
48 $nntp->quit or print "not ";
49}
50print "ok 4\n";
51