Changed some tests to use use_ok(). Added $Id tags to all tests.
David Wheeler
21 years ago
|
0 |
#!/usr/bin/perl -w
|
|
1 |
|
|
2 |
# $Id: Makefile.PL,v 1.3 2002/08/22 16:10:24 david Exp $
|
|
3 |
|
|
4 |
use strict;
|
0 | 5 |
use ExtUtils::MakeMaker;
|
1 | 6 |
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
2 | 7 |
# the contents of the Makefile that is written.
|
0 | 0 |
#!/usr/bin/perl -w
|
|
1 |
|
|
2 |
# $Id: dbh.t,v 1.3 2002/08/22 16:10:24 david Exp $
|
1 | 3 |
|
2 | 4 |
use strict;
|
3 | 5 |
use Test::More (tests => 27);
|
|
14 | 16 |
END { $dbh->disconnect if $dbh };
|
15 | 17 |
|
16 | 18 |
# Check that the error_handler has been installed.
|
17 | |
ok( UNIVERSAL::isa($dbh->{HandleError}, 'CODE'), "Check HandlError" );
|
|
19 |
isa_ok( $dbh->{HandleError}, 'CODE' );
|
18 | 20 |
|
19 | 21 |
# Trigger an exception.
|
20 | 22 |
eval {
|
|
23 | 25 |
|
24 | 26 |
# Make sure we got the proper exception.
|
25 | 27 |
ok( my $err = $@, "Get exception" );
|
26 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI'), "Check E::C::DBI" );
|
27 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI::H'),
|
28 | |
"Check E::C::DBI::H" );
|
29 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI::DBH'),
|
30 | |
"Check E::C::DBI::DBH" );
|
|
28 |
isa_ok( $err, 'Exception::Class::DBI' );
|
|
29 |
isa_ok( $err, 'Exception::Class::DBI::H' );
|
|
30 |
isa_ok( $err, 'Exception::Class::DBI::DBH' );
|
31 | 31 |
|
32 | 32 |
# Check the accessor values.
|
33 | 33 |
ok( $err->err == 1, "Check err" );
|
0 | 0 |
#!/usr/bin/perl -w
|
|
1 |
|
|
2 |
# $Id: drh.t,v 1.4 2002/08/22 16:10:24 david Exp $
|
1 | 3 |
|
2 | 4 |
use strict;
|
3 | 5 |
use Test::More (tests => 21);
|
|
25 | 27 |
skip 'HandleError not logic not yet used by DBI->connect', 20
|
26 | 28 |
unless $@;
|
27 | 29 |
ok( my $err = $@, "Caught exception" );
|
28 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI'), "Check E::C::DBI" );
|
29 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI::H'),
|
30 | |
"Check E::C::DBI::H" );
|
31 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI::DRH'),
|
32 | |
"Check E::C::DBI::DRH" );
|
|
30 |
isa_ok( $err, 'Exception::Class::DBI' );
|
|
31 |
isa_ok( $err, 'Exception::Class::DBI::H' );
|
|
32 |
isa_ok( $err, 'Exception::Class::DBI::DRH' );
|
33 | 33 |
ok( $err->err == 7, "Check err" );
|
34 | 34 |
is( $err->error,
|
35 | 35 |
'DBI->connect(dummy) failed: Dammit Jim!', 'Check error' );
|
0 | 0 |
#!/usr/bin/perl -w
|
|
1 |
|
|
2 |
# $Id: sth.t,v 1.3 2002/08/22 16:10:24 david Exp $
|
1 | 3 |
|
2 | 4 |
use strict;
|
3 | 5 |
use Test::More (tests => 35);
|
|
16 | 18 |
END { $dbh->disconnect if $dbh };
|
17 | 19 |
|
18 | 20 |
# Check that the error_handler has been installed.
|
19 | |
ok( UNIVERSAL::isa($dbh->{HandleError}, 'CODE'), "Check HandlError" );
|
|
21 |
isa_ok( $dbh->{HandleError}, 'CODE' );
|
20 | 22 |
|
21 | 23 |
# Trigger an exception.
|
22 | 24 |
eval {
|
|
28 | 30 |
|
29 | 31 |
# Make sure we got the proper exception.
|
30 | 32 |
ok( my $err = $@, "Get exception" );
|
31 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI'), "Check E::C::DBI" );
|
32 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI::H'),
|
33 | |
"Check E::C::DBI::H" );
|
34 | |
ok( UNIVERSAL::isa($err, 'Exception::Class::DBI::STH'),
|
35 | |
"Check E::C::DBI::STH" );
|
|
33 |
isa_ok( $err, 'Exception::Class::DBI' );
|
|
34 |
isa_ok( $err, 'Exception::Class::DBI::H' );
|
|
35 |
isa_ok( $err, 'Exception::Class::DBI::STH' );
|
36 | 36 |
|
37 | 37 |
ok( $err->err == 7, "Check err" );
|
38 | 38 |
is( $err->errstr, 'ERROR: Relation "foo" does not exist',
|