Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv22423/tests
Modified Files:
TestPOP3.tst
Log Message:
Tests for the CAPA command and a list of TODOs for the completion of the POP3 test suite
Index: TestPOP3.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestPOP3.tst,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestPOP3.tst 31 Jul 2003 16:32:22 -0000 1.4
--- TestPOP3.tst 31 Jul 2003 22:03:47 -0000 1.5
***************
*** 248,251 ****
--- 248,252 ----
test_assert( `cp -R corpus.base corpus` == 0 );
test_assert( `rm -rf corpus/CVS` == 0 );
+ test_assert( `rm -rf messages/*` == 0 );
my $c = new POPFile::Configuration;
***************
*** 454,457 ****
--- 455,461 ----
# Now get a message that actually exists
+ unlink( 'messages/popfile1=1.msg' );
+ unlink( 'messages/popfile1=1.cls' );
+
print $client "RETR 1$eol";
$result = <$client>;
***************
*** 460,464 ****
$cam =~ s/msg$/cam/;
! open FILE, "<$cam";
while ( <FILE> ) {
my $line = $_;
--- 464,468 ----
$cam =~ s/msg$/cam/;
! test_assert( open FILE, "<$cam" );
while ( <FILE> ) {
my $line = $_;
***************
*** 474,480 ****
test_assert_equal( $result, ".$eol" );
# TODO check for NEWFL and CLASS messages
! # TODO check that the file was written to the history
# Try an unsuccessful delete
--- 478,510 ----
test_assert_equal( $result, ".$eol" );
+ # This delay is here because Windows was having a little trouble
+ # with the files created by the RETR not existing and I have a little
+ # rest here while Windows wakes from its afternoon nap and writes
+ # the files to disk
+
+ select( undef, undef, undef, 0.1 );
+
# TODO check for NEWFL and CLASS messages
! test_assert( -e 'messages/popfile1=1.msg' );
! test_assert( -e 'messages/popfile1=1.cls' );
!
! test_assert( open FILE, "<$messages[0]" );
! test_assert( open HIST, "<messages/popfile1=1.msg" );
! while ( ( my $fl = <FILE> ) && ( my $ml = <HIST> ) ) {
! $fl =~ s/[\r\n]//g;
! $ml =~ s/[\r\n]//g;
! test_assert_equal( $fl, $ml );
! }
! test_assert( eof(FILE) );
! test_assert( eof(HIST) );
! close FILE;
! close HIST;
!
! my ( $reclassified, $bucket, $usedtobe, $magnet ) = $b->history_read_class( 'popfile1=1.msg' );
! test_assert( !$reclassified );
! test_assert_equal( $bucket, 'spam' );
! test_assert( !defined( $usedtobe ) );
! test_assert_equal( $magnet, '' );
# Try an unsuccessful delete
***************
*** 490,493 ****
--- 520,541 ----
test_assert_equal( $result, "+OK Deleted 1$eol" );
+ # Check that CAPA command works once we are connected
+
+ print $client "CAPA$eol";
+ $result = <$client>;
+ test_assert_equal( $result, "+OK I can handle$eol" );
+ $result = <$client>;
+ test_assert_equal( $result, "AUTH$eol" );
+ $result = <$client>;
+ test_assert_equal( $result, "USER$eol" );
+ $result = <$client>;
+ test_assert_equal( $result, "APOP$eol" );
+ $result = <$client>;
+ test_assert_equal( $result, ".$eol" );
+
+ # Check the basic TOP command
+
+ # TODO
+
# Check that we echo the remote servers QUIT response
***************
*** 497,500 ****
--- 545,556 ----
close $client;
+
+ # TODO QUIT straight after connect
+
+ # TODO odd command straight after connect gives error
+
+ # TODO -pop3_toptoo tests with caching behavior
+
+ # TODO SPA/AUTH tests with good and bad remote servers
while ( waitpid( $pid, &WNOHANG ) != $pid ) {
|