Skip to content

Commit 60da6c6

Browse files
committed
Add tests for bulk insertion of binary
1 parent 8ee9c84 commit 60da6c6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

t/10-resultset-blob.t

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BEGIN { eval { require Digest::SHA; 1 } or plan skip_all => 'requires Digest::SH
1212

1313
BEGIN { DodTestUtil->check_driver }
1414

15-
plan tests => 3;
15+
plan tests => 5;
1616

1717
setup_dbs({
1818
global => [ qw( wines ) ],
@@ -40,7 +40,13 @@ $wine = Wine->lookup($wine_id);
4040
ok $wine;
4141
ok $wine->content eq $binary;
4242

43-
# TODO: bulk_insert doesn't support blob yet. We need to change some of its API so that we can call column_def in each dbd's bulk_insert
43+
my @names = qw(Margaux Latour);
44+
Wine->bulk_insert([qw(name content)], [ map {[$_, Digest::SHA::sha1($_)]} @names ]);
45+
46+
for my $name (@names) {
47+
my ($found) = Wine->search({name => $name});
48+
ok $found->content eq Digest::SHA::sha1($name);
49+
}
4450

4551
disconnect_all($wine);
4652
teardown_dbs(qw( global ));

0 commit comments

Comments
 (0)