summaryrefslogtreecommitdiffstats
path: root/t/search.t
diff options
context:
space:
mode:
Diffstat (limited to 't/search.t')
-rw-r--r--t/search.t10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/search.t b/t/search.t
index 2f6bb84..0e8ee9c 100644
--- a/t/search.t
+++ b/t/search.t
@@ -14,11 +14,13 @@ BEGIN
or plan skip_all =>
"DBD::CSV is needed for this test";
- plan tests => 9;
+ plan tests => 13;
unlink('foo_table') if ( -e 'foo_table' );
my $dbh = DBI->connect('DBI:CSV:f_dir=./') or die $DBI::errstr;
$dbh->do('create table foo_table (id INTEGER, name CHAR(255), password CHAR(255), email CHAR(255))') or $dbh->errstr;
+ $dbh->do("insert into foo_table values (2, 'foo', 'pass', 'foo\@bar.org')") or $dbh->errstr;
+ $dbh->do("insert into foo_table values (3, 'bar', 'pass', 'bar\@foo.org')") or $dbh->errstr;
$dbh->disconnect();
use_ok('Foo');
@@ -34,6 +36,12 @@ ok(Foo->search_like(name => 'j%') > 0,'search_like returns array');
ok(Foo->search_ilike() > 0,'search_ilike returns array');
ok(Foo->search_or_like() > 0,'search_or_like returns array');
ok(Foo->search_or_ilike() > 0,'search_or_ilike returns array');
+ok(Foo->search(name => ['jason','foo','bar']) == 3, 'search() using arrayref');
+ok(Foo->search_like(name => ['%jason','%foo','%bar'], password => 'pass') == 3, 'search_like() using arrayref');
+#PG specific #ok(Foo->search_ilike(name => ['%jason','%foo','%bar'], password => 'pass') == 3, 'search_ilike() using arrayref');
+#PG specific #ok(Foo->search_or_ilike(name => ['%jason','%foo','%bar'], password => 'pass') == 3, 'search_or_ilike() using arrayref');
+ok(Foo->search_or(name => ['jason','foo','bar'], password => 'pass') == 3, 'search_or() using arrayref');
+ok(Foo->search_or_like(name => ['%jason','%foo','%bar'], password => 'pass') == 3, 'search_or_like() using arrayref');
END
{