1use strict; 2use warnings; 3 4use Test::More; 5use DBI; 6 7use vars qw($test_dsn $test_user $test_password); 8use lib 't', '.'; 9require 'lib.pl'; 10 11my $dbh; 12eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password, 13 { RaiseError => 0, PrintError => 0, AutoCommit => 0 });}; 14if (!$dbh) { 15 plan skip_all => "no database connection"; 16} 17 18plan tests => 1; 19 20$dbh->do( 'this should die' ); 21ok $DBI::errstr, 'error string should be set on a bad call'; 22 23$dbh->disconnect; 24