3 use Test::More tests => 8;
5 BEGIN { use_ok('Net::Cmd') }
6 BEGIN { use_ok('Net::NNTP') }
8 my $c = Net::NNTP->new(Host => '127.0.0.1', Port => 20203, Reader => 0);
10 ok(defined $c, 'connected to localhost');
12 BAIL_OUT(q{can't connect to test server'}) unless $c;
14 sub Net::NNTP::issue {
22 my ($c, $cmd, $test, @valid) = @_;
25 ok(scalar (grep {$c->code == $_} @valid) , "$test ".$c->code." in (@valid)");
29 # 3977:5.1.1 initial greeting must be 200 201 400 502
30 my @valid = (200, 201, 400, 502);
31 my $greeting = $c->code;
33 ok(grep {$c->code == $_} @valid, 'correct initial response from server');
35 unless ($greeting == 200 or $greeting = 201) {
36 BAIL_OUT(q{bad greeting from server'});
39 # 4 tests done to here
41 $c->try('STAT','stat with no newsgroup',412);
42 $c->try('GROUP de.test','group selection',211);
43 $c->try('STAT','stat with newsgroup',223,420);
49 $c->try('QUIT','quit',205);