ok($twice == 0, 'No capability listed twice (3977:5.2.2)');
ok(exists $cap{READER}, 'announce READER');
is($cap{'MODE-READER'}, undef, q{don't announce MODE-READER});
- foreach $trycap qw(ACTIVE NEWSGROUPS OVERVIEW.FMT
- ACTIVE.TIMES HEADERS) {
+ foreach $trycap (qw(ACTIVE NEWSGROUPS OVERVIEW.FMT
+ ACTIVE.TIMES HEADERS)) {
cmp_ok(scalar(grep { $trycap eq $_ } @{$cap{LIST}}), '==', 1,
"list capability $trycap");
}
- foreach $trycap qw(MSGID) {
+ foreach $trycap (qw(MSGID)) {
cmp_ok(scalar(grep { $trycap eq $_ } @{$cap{OVER}}), '==', 1,
"list capability $trycap");
}
return $c->code;
}
+sub Net::NNTP::must {
+ my ($c, $cmd, $test, @valid) = @_;
+ $c->command($cmd);
+ $c->response();
+ ok(scalar (grep {$c->code == $_} @valid) , "$test ".$c->code." in (@valid)");
+ if (scalar (grep {$c->code == $_} @valid)) {
+ return $c->code;
+ }
+ die $c->code;
+}
+
# 3977:5.1.1 initial greeting must be 200 201 400 502
my @valid = (200, 201, 400, 502);
my $greeting = $c->code;
# 4 tests done to here
$c->try('STAT','stat with no newsgroup',412);
-$c->try('GROUP de.test','group selection',211);
-$c->try('STAT','stat with newsgroup',223,420);
+
+eval {
+ $c->must('GROUP de.test','group selection',211);
+};
+SKIP: {
+ skip "group failed, can't stat", 1 if $@;
+ $c->try('STAT','stat with newsgroup',223,420);
+}
goto quit;