--- trunk/t/pgest.t 2005/05/22 21:18:11 9 +++ trunk/t/pgest.t 2005/05/25 23:38:37 12 @@ -2,7 +2,7 @@ use strict; -use Test::More tests => 33; +use Test::More tests => 49; BEGIN { use_ok('DBI'); @@ -33,7 +33,10 @@ sub pgest { $sth->execute(@_) || die $sth->errstr(); - ok($sth, "execute(".join(",",@_).")"); + { + no warnings; + ok($sth, "execute(".join(",",@_).")"); + } my @arr; while (my $row = $sth->fetchrow_hashref() ) { @@ -83,3 +86,12 @@ cmp_ok(scalar pgest('', $q, 0, 0), '==', $hits, 'blade runner'); } +diag "Error handling test follows, ignore messages..."; +# test NULL handling +ok(! $dbh->do(qq{select * from pgest(null, '', '', 0, 0)}), "null index_path"); +ok(my $hits = pgest('blade runner', '', 0, 0), "test search"); +cmp_ok($hits, '==', pgest('blade runner', undef, 0, 0), "null attr"); +cmp_ok($hits, '==', pgest('blade runner', '', undef, 0), "null limit"); +cmp_ok($hits, '==', pgest('blade runner', '', 0, undef), "null offset"); +cmp_ok($hits, '==', pgest('blade runner', undef, undef, undef), "null optional"); +