Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22708/tests
Modified Files:
Tag: b0_22_2
TestBayes.tst
Log Message:
Add tests for the new method
Index: TestBayes.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestBayes.tst,v
retrieving revision 1.56.6.2
retrieving revision 1.56.6.3
diff -C2 -d -r1.56.6.2 -r1.56.6.3
*** TestBayes.tst 21 Feb 2006 13:55:55 -0000 1.56.6.2
--- TestBayes.tst 4 Mar 2008 13:23:29 -0000 1.56.6.3
***************
*** 187,190 ****
--- 187,203 ----
test_assert_equal( $b->get_count_for_word( $session, $buckets[2], 'foo'), 0 );
+ # Test validation of sql
+
+ my $sql = "SELECT * FROM words WHERE word IN ( 'f\x00oo', 'baz' )";
+ my $sth = $b->validate_sql_prepare_and_execute( $sql );
+ test_assert_equal( ref $sth, 'DBI::st' );
+ test_assert_equal( scalar @{$sth->fetchall_arrayref}, 2 );
+
+ # same thing with bind-params
+ $sql = "SELECT * FROM words WHERE word IN ( ?, ? )";
+ $sth = $b->validate_sql_prepare_and_execute( $sql, "f\x00oo", 'baz' );
+ test_assert_equal( ref $sth, 'DBI::st' );
+ test_assert_equal( scalar @{$sth->fetchall_arrayref}, 2 );
+
# get_unique_word_count
***************
*** 993,997 ****
close CLIENT;
close MAIL;
!
test_assert_equal( $class, 'gomi' );
test_assert( -e $h->get_slot_file( $slot ) );
--- 1006,1010 ----
close CLIENT;
close MAIL;
!
test_assert_equal( $class, 'gomi' );
test_assert( -e $h->get_slot_file( $slot ) );
|