Skip to content

Commit 5535fc0

Browse files
committed
Add a test for (foo => {op => "LIKE", value => "..."})
1 parent 5e87eeb commit 5535fc0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

t/11-sql.t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use strict;
44

55
use Data::ObjectDriver::SQL;
6-
use Test::More tests => 90;
6+
use Test::More tests => 93;
77

88
my $stmt = ns();
99
ok($stmt, 'Created SQL object');
@@ -144,6 +144,11 @@ is(scalar @{ $stmt->bind }, 2);
144144
is($stmt->bind->[0], 'bar');
145145
is($stmt->bind->[1], 'baz');
146146

147+
$stmt = ns(); $stmt->add_where(foo => { op => 'LIKE', value => 'bar%' });
148+
is($stmt->as_sql_where, "WHERE (foo LIKE ?)\n");
149+
is(scalar @{ $stmt->bind }, 1);
150+
is($stmt->bind->[0], 'bar%');
151+
147152
$stmt = ns(); $stmt->add_where(foo => { op => '!=', value => 'bar' });
148153
is($stmt->as_sql_where, "WHERE (foo != ?)\n");
149154
is(scalar @{ $stmt->bind }, 1);

0 commit comments

Comments
 (0)