# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN {print "1..37\n";} END {print "not ok 1\n" unless $loaded;} use News::NNTPClient; $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): print <gmt(1); $c->fourdigityear(1); for $f (qw(version debug eol gmt fourdigityear message code ok okprint postok mode_reader list help slave)) { print "not " unless $c->$f(); print "ok ", $i++, " ($f)\n"; } print <post(split(/\n/,<group($TESTGROUP); print "ok ", $i++, " (group)\n"; for $f (qw(article body head last next stat)) { print "not " unless $msgid = $c->$f($last); print "ok ", $i++, " ($f)\n"; } # My server does not understand four digit years. $c->fourdigityear(0); for $f (qw(newgroups newnews)) { print "not " unless $c->$f(time()); print "ok ", $i++, " ($f)\n"; } # I can't test these two, and I doubt many people can. # ihave authinfo for $f (qw(date listgroup)) { print "not " unless $c->$f(); print "ok ", $i++, " ($f)\n"; } print <xpath($msgid); print "ok ", $i++, " (xpath $msgid)\n"; for $f (qw(xgtitle xhdr xpat xover xmotd xthread xindex xsearch)) { print "not " unless $c->$f(); print "ok ", $i++, " ($f)\n"; } print <quit(); print "ok ", $i++, " (quit)\n";