File: lazy-load.t

package info (click to toggle)
libdbd-multi-perl 1.02-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 196 kB
  • sloc: perl: 342; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 529 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# vim: ft=perl
use Test::More 'no_plan';
use Test::Exception;

# Test that the handles are lazy-loaded. 
use strict;
$^W = 1;

use DBI;
my $c = DBI->connect('DBI:Multi:', undef, undef, {
    dsns => [
        1 => ['dbi:Boom', '',''],
    ],
});

isa_ok $c, 'DBI::db', "invalid connect strict survives DBD::Multi connect()";

dies_ok { $c->prepare("CREATE TABLE multi(id int)") }
 "invalid connect string blows up when handle is actually attempted to be used";

lives_ok { $c->disconnect } 
  "Don't connect just to disconnect";