|
From: <jgr...@us...> - 2003-09-09 01:28:09
|
Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv14716/tests
Modified Files:
TestBayes.tst TestHTML.script
Log Message:
HTML.pm:
Fix minor bugs pointed out by the test suite.
TestHTML.tst/TestHTML.script:
Tests for magnet classified mails, showing them in the
main history list, filter for magnet classified and
non-magnet classified mails, looking at a message in
the single message view and checking the magnet use
highlighting.
With this commit we have 100% line coverage for the
HTML.pm module (and with the previous commits today
100% coverage for all shipping POPFile modules).
Index: TestBayes.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestBayes.tst,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** TestBayes.tst 8 Sep 2003 18:03:57 -0000 1.26
--- TestBayes.tst 9 Sep 2003 00:28:20 -0000 1.27
***************
*** 66,73 ****
# Test the unclassifier_probability parameter
- test_assert_equal( $b->{unclassified__}, log(100) );
- $b->config_( 'unclassified_weight', 10 );
- test_assert( $b->start() );
test_assert_equal( $b->{unclassified__}, log(10) );
$b->config_( 'unclassified_weight', 5 );
test_assert( $b->start() );
--- 66,73 ----
# Test the unclassifier_probability parameter
test_assert_equal( $b->{unclassified__}, log(10) );
+ $b->config_( 'unclassified_weight', 9 );
+ test_assert( $b->start() );
+ test_assert_equal( $b->{unclassified__}, log(9) );
$b->config_( 'unclassified_weight', 5 );
test_assert( $b->start() );
Index: TestHTML.script
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestHTML.script,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** TestHTML.script 8 Sep 2003 18:03:57 -0000 1.16
--- TestHTML.script 9 Sep 2003 00:28:20 -0000 1.17
***************
*** 187,190 ****
--- 187,222 ----
MATCH popfile10000=1
+ # Check magnet classified mails
+
+ NOTMATCH Magnetic Attraction for Ferrous Females
+ MATCH (<a class="history" href="/history?session=$sk&setfilter=">Refresh</a>)
+ CODE
+ open NEWMSG, ">messages/popfile10002=1.msg";
+ print NEWMSG <<EOM;
+ From: foo-magnet\@magnetmania.com
+ Subject: Magnetic Attraction for Ferrous Females
+
+ Align your pole to magnetic north
+ EOM
+ close NEWMSG;
+ open NEWCLS, ">messages/popfile10002=1.cls";
+ print NEWCLS "personal MAGNET from: foo\n";
+ close NEWCLS;
+ ENDCODE
+ SENDMSG NEWFL popfile10002=1.msg
+ GET /history?session=$sk&setfilter=
+ MATCH foo-magnet\@magnetmania.com
+ MATCH Magnetic Attraction for Ferrous Females
+ MATCH personal
+ MATCH popfile10002=1
+ MATCH Magnet used: from: foo
+
+ GET /view?view=popfile10002=1.msg&start_message=0&session=$sk
+ MATCH Single Message View
+ MATCH foo-magnet\@magnetmania.com
+ MATCH Magnetic Attraction for Ferrous Females
+ MATCH Magnet used: from: foo
+ MATCH <font color="green">foo</font>
+
# Check search
***************
*** 241,244 ****
--- 273,286 ----
MATCH (just showing bucket <font color="red">other</font>)
MATCH No messages.
+ SETINPUT filter __filter__magnet
+ CLICK setfilter
+ MATCH (just showing magnet classified messages)
+ MATCH Magnetic Attraction for Ferrous Females
+ NOTMATCH Testing Refresh
+ SETINPUT filter __filter__no__magnet
+ CLICK setfilter
+ MATCH (just showing non-magnet classified messages)
+ NOTMATCH Magnetic Attraction for Ferrous Females
+ MATCH Testing Refresh
CLICK reset_filter_search
***************
*** 258,262 ****
GET /history
MATCH Testing Refresh
! SETINPUT 0 spam
CLICK change
MATCH Changed to <font color="blue">spam</font>
--- 300,304 ----
GET /history
MATCH Testing Refresh
! SETINPUT 1 spam
CLICK change
MATCH Changed to <font color="blue">spam</font>
***************
*** 265,269 ****
# Check undo
! CLICK undo_0
MATCH Changed to <font color="green">personal</font>
--- 307,311 ----
# Check undo
! CLICK undo_1
MATCH Changed to <font color="green">personal</font>
***************
*** 336,340 ****
MATCH Single Message View
MATCH Testing Refresh
! SETINPUT 0 spam
CLICK change
MATCH Changed to <font color="blue">spam</font>
--- 378,382 ----
MATCH Single Message View
MATCH Testing Refresh
! SETINPUT 1 spam
CLICK change
MATCH Changed to <font color="blue">spam</font>
***************
*** 345,349 ****
GET /view?view=popfile10000=1.msg&start_message=0&session=$sk
MATCH Single Message View
! CLICK undo_0
MATCH Changed to <font color="green">personal</font>
--- 387,391 ----
GET /view?view=popfile10000=1.msg&start_message=0&session=$sk
MATCH Single Message View
! CLICK undo_1
MATCH Changed to <font color="green">personal</font>
***************
*** 352,356 ****
GET /history
MATCH Testing Refresh
! SETINPUT remove_1 on
CLICK deletemessage
MATCH Recent Messages
--- 394,398 ----
GET /history
MATCH Testing Refresh
! SETINPUT remove_2 on
CLICK deletemessage
MATCH Recent Messages
***************
*** 361,366 ****
MATCH test for various HTML parts
MATCH Enlarge your package Doctor ApprovedNHOB
- SETINPUT remove_4 on
SETINPUT remove_5 on
CLICK deletemessage
NOTMATCH test for various HTML parts
--- 403,408 ----
MATCH test for various HTML parts
MATCH Enlarge your package Doctor ApprovedNHOB
SETINPUT remove_5 on
+ SETINPUT remove_6 on
CLICK deletemessage
NOTMATCH test for various HTML parts
|