summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2007-05-16 01:36:48 +0000
committerJason Woodward2007-05-16 01:36:48 +0000
commit9b03370ba51092b3a366b021a0dad95b9e0bb858 (patch)
tree4e77830a664050b4577bcb96312d4a211d6d40d6
parentdd49bfd37cfbbf70e5bdd8360e8f1731dfd83e9c (diff)
downloadJaos-DBI-9b03370ba51092b3a366b021a0dad95b9e0bb858.tar.gz
added a few extra search tests
-rw-r--r--t/search.t4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/search.t b/t/search.t
index 9c73246..817c7f8 100644
--- a/t/search.t
+++ b/t/search.t
@@ -14,7 +14,7 @@ BEGIN
or plan skip_all =>
"DBD::CSV is needed for this test";
- plan tests => 13;
+ plan tests => 14;
unlink('foo_table') if ( -e 'foo_table' );
my $dbh = DBI->connect('DBI:CSV:f_dir=./') or die $DBI::errstr;
@@ -32,6 +32,8 @@ isa_ok($obj,'Foo');
ok(Foo->search(name => 'jason') > 0,'search returns array');
ok(Foo->search(name => 'jason',{ order_by => 'id'}) > 0,'search with order_by returns array');
ok(Foo->search({ where => "name = 'jason'" }) > 0,'search where returns array');
+ok(Foo->search({ where => "name = 'jason'", order_by => 'name' }) > 0,'search where with options returns array');
+ok((Foo->search({ where => "email like '%org'", order_by => 'name' }))[0]->name eq 'bar','search where with sort option returns correct first element');
ok(Foo->search(name => 'j%', { operator => 'like' }) > 0,'search like returns array');
ok(Foo->search({ operator => 'ilike' }) > 0,'search ilike returns array');
ok(Foo->search({ boolean => 'or', operator => 'like' }) > 0,'search or like returns array');