/[pgestraier]/trunk/t/pgest.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/pgest.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by dpavlin, Sun May 22 21:18:11 2005 UTC revision 12 by dpavlin, Wed May 25 23:38:37 2005 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4    
5  use Test::More tests => 33;  use Test::More tests => 49;
6    
7  BEGIN {  BEGIN {
8          use_ok('DBI');          use_ok('DBI');
# Line 33  ok($sth, "sth"); Line 33  ok($sth, "sth");
33    
34  sub pgest {  sub pgest {
35          $sth->execute(@_) || die $sth->errstr();          $sth->execute(@_) || die $sth->errstr();
36          ok($sth, "execute(".join(",",@_).")");          {
37                    no warnings;
38                    ok($sth, "execute(".join(",",@_).")");
39            }
40    
41          my @arr;          my @arr;
42          while (my $row = $sth->fetchrow_hashref() ) {          while (my $row = $sth->fetchrow_hashref() ) {
# Line 83  foreach my $q (('@title STRINC Blade Run Line 86  foreach my $q (('@title STRINC Blade Run
86          cmp_ok(scalar pgest('', $q, 0, 0), '==', $hits, 'blade runner');          cmp_ok(scalar pgest('', $q, 0, 0), '==', $hits, 'blade runner');
87  }  }
88    
89    diag "Error handling test follows, ignore messages...";
90    # test NULL handling
91    ok(! $dbh->do(qq{select * from pgest(null, '', '', 0, 0)}), "null index_path");
92    ok(my $hits = pgest('blade runner', '', 0, 0), "test search");
93    cmp_ok($hits, '==', pgest('blade runner', undef, 0, 0), "null attr");
94    cmp_ok($hits, '==', pgest('blade runner', '', undef, 0), "null limit");
95    cmp_ok($hits, '==', pgest('blade runner', '', 0, undef), "null offset");
96    cmp_ok($hits, '==', pgest('blade runner', undef, undef, undef), "null optional");
97    

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26