Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv28368/tests
Modified Files:
TestBayes.tst TestHTML.tst
Log Message:
Restored POPFile test suite to working order, note that many tests are currently failing and need to be udpated, I am on this. Also added code to detect the Camouflage spam trick by using Pythagoras on the two RGB values
Index: TestBayes.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestBayes.tst,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TestBayes.tst 16 Apr 2003 01:26:45 -0000 1.9
--- TestBayes.tst 18 Jun 2003 20:34:55 -0000 1.10
***************
*** 9,17 ****
--- 9,40 ----
use Classifier::Bayes;
use POPFile::Configuration;
+ use POPFile::MQ;
+ use POPFile::Logger;
# Load the test corpus
my $c = new POPFile::Configuration;
+ my $mq = new POPFile::MQ;
+ my $l = new POPFile::Logger;
my $b = new Classifier::Bayes;
+
+ $c->configuration( $c );
+ $c->mq( $mq );
+ $c->logger( $l );
+
+ $l->configuration( $c );
+ $l->mq( $mq );
+ $l->logger( $l );
+
+ $l->initialize();
+
+ $mq->configuration( $c );
+ $mq->mq( $mq );
+ $mq->logger( $l );
+
$b->configuration( $c );
+ $b->mq( $mq );
+ $b->logger( $l );
+
+
$b->initialize();
$b->config_( 'corpus', 'tests/corpus' );
Index: TestHTML.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestHTML.tst,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestHTML.tst 27 Feb 2003 00:55:25 -0000 1.1
--- TestHTML.tst 18 Jun 2003 20:34:55 -0000 1.2
***************
*** 8,17 ****
use UI::HTML;
! my $c = new UI::HTML;
! test_assert_equal( $c->url_encode( ']' ), '%5d' );
! test_assert_equal( $c->url_encode( '[' ), '%5b' );
! test_assert_equal( $c->url_encode( '[]' ), '%5b%5d' );
! test_assert_equal( $c->url_encode( '[foo]' ), '%5bfoo%5d' );
--- 8,42 ----
use UI::HTML;
+ use POPFile::Configuration;
+ use POPFile::MQ;
+ use POPFile::Logger;
! my $c = new POPFile::Configuration;
! my $mq = new POPFile::MQ;
! my $l = new POPFile::Logger;
! $c->configuration( $c );
! $c->mq( $mq );
! $c->logger( $l );
!
! $l->configuration( $c );
! $l->mq( $mq );
! $l->logger( $l );
!
! $l->initialize();
!
! $mq->configuration( $c );
! $mq->mq( $mq );
! $mq->logger( $l );
!
! my $h = new UI::HTML;
!
! $h->configuration( $c );
! $h->mq( $mq );
! $h->logger( $l );
!
! test_assert_equal( $h->url_encode_( ']' ), '%5d' );
! test_assert_equal( $h->url_encode_( '[' ), '%5b' );
! test_assert_equal( $h->url_encode_( '[]' ), '%5b%5d' );
! test_assert_equal( $h->url_encode_( '[foo]' ), '%5bfoo%5d' );
|