Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv20912/tests
Modified Files:
TestHTML.script TestHTML.tst TestWordMangle.tst
Log Message:
Added tests for the HTML Advanced page and added new assertion type to test harness
Index: TestHTML.script
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestHTML.script,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TestHTML.script 22 Aug 2003 00:04:24 -0000 1.7
--- TestHTML.script 22 Aug 2003 00:25:52 -0000 1.8
***************
*** 32,35 ****
--- 32,36 ----
# GET <url> Get the URL (note the host and port will be added for you)
# MATCH <data> Match the return from last URL fetch against the data
+ # NOTMATCH <data> Must not match the return from last URL fetch against the data
# MATCH/ENDMATCH Encloses a block of test to find in the return from the last URL fetch
# CODE/ENDCODE Arbitrary code that should be executed
***************
*** 396,399 ****
--- 397,401 ----
SETSUBMIT password
INPUTIS password
+ CONFIGIS html_password
MATCH Updated password to
***************
*** 416,424 ****
CONFIGIS newword
! SETSUBMIT newword four
! MATCH four
! # TODO Check remove ignore word
! # TODO Check change arbitrary parameter
# TODO Check shutdown operation
--- 418,437 ----
CONFIGIS newword
! SETSUBMIT newword four11@.-_
! MATCH four11@.-_
! SETSUBMIT newword ba"d
! MATCH Ignored words can only contain alphanumeric, ., _, -, or @ characters
! # Check remove ignore word
!
! CONFIGIS word
! SETSUBMIT word four11@.-_
! NOTMATCH four11@.-_
!
! # Check change arbitrary parameter
!
! SETSUBMIT parameter_bayes_hostname testhostname
! CONFIGIS bayes_hostname testhostname
! INPUTIS parameter_bayes_hostname testhostname
# TODO Check shutdown operation
Index: TestHTML.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestHTML.tst,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** TestHTML.tst 22 Aug 2003 00:04:24 -0000 1.11
--- TestHTML.tst 22 Aug 2003 00:25:52 -0000 1.12
***************
*** 33,37 ****
unlink( 'stopwords' );
open STOPS, ">stopwords";
! print "one\ntwo\nthree\n";
close STOPS;
--- 33,37 ----
unlink( 'stopwords' );
open STOPS, ">stopwords";
! print STOPS "one\ntwo\nthree\n";
close STOPS;
***************
*** 282,287 ****
}
! if ( $line =~ /^(SETINPUT|SETSUBMIT) +([^ ]+) (.+)$/ ) {
! form_input( $2, $3 );
next if ( $line =~ /^SETINPUT/ );
}
--- 282,289 ----
}
! if ( $line =~ /^(SETINPUT|SETSUBMIT) +([^ ]+) ?(.+)?$/ ) {
! my ( $name, $value ) = ( $2, $3 );
! $value = '' if ( !defined( $value ) );
! form_input( $name, $value );
next if ( $line =~ /^SETINPUT/ );
}
***************
*** 301,304 ****
--- 303,311 ----
if ( $line =~ /^MATCH +(.+)$/ ) {
test_assert_regexp( $content, "\Q$1\E", "From script line $line_number" );
+ next;
+ }
+
+ if ( $line =~ /^NOTMATCH +(.+)$/ ) {
+ test_assert_not_regexp( $content, "\Q$1\E", "From script line $line_number" );
next;
}
Index: TestWordMangle.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestWordMangle.tst,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestWordMangle.tst 31 Jul 2003 16:32:22 -0000 1.4
--- TestWordMangle.tst 22 Aug 2003 00:25:52 -0000 1.5
***************
*** 48,51 ****
--- 48,52 ----
test_assert_equal( $w->add_stopword( 'A1234bef66' ), 0 );
test_assert_equal( $w->remove_stopword( 'A1234bef66' ), 0 );
+ test_assert_equal( $w->add_stopword( 'b*ox' ), 0 );
# Getter/setter
|