mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 14:19:10 -04:00
Zero functional changes, simply executed the following: find . -name '*.t' -exec perl -0777 -p -i -e 's|^use t::lib::SQLiteTest|use lib "t/lib";\nuse SQLiteTest|m' {} + Also had to do a manual (but identical) fix in t/01_compile.t
32 lines
848 B
Perl
32 lines
848 B
Perl
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
BEGIN {
|
|
$| = 1;
|
|
$^W = 1;
|
|
}
|
|
|
|
use lib "t/lib";
|
|
use SQLiteTest;
|
|
use Test::More tests => 8;
|
|
use Test::NoWarnings;
|
|
|
|
my $dbh = connect_ok( RaiseError => 1, PrintError => 0 );
|
|
eval {
|
|
$dbh->do('ssdfsdf sdf sd sdfsdfdsf sdfsdf');
|
|
};
|
|
ok($@, 'Statement 1 generated an error');
|
|
is( $DBI::err, 1, '$DBI::err ok' );
|
|
is( $DBI::errstr, 'near "ssdfsdf": syntax error', '$DBI::errstr ok' );
|
|
|
|
$dbh->do('create table testerror (a, b)');
|
|
$dbh->do('insert into testerror values (1, 2)');
|
|
$dbh->do('insert into testerror values (3, 4)');
|
|
|
|
$dbh->do('create unique index testerror_idx on testerror (a)');
|
|
eval {
|
|
$dbh->do('insert into testerror values (1, 5)');
|
|
};
|
|
ok($@, 'Statement 2 generated an error');
|
|
is( $DBI::err, 19, '$DBI::err ok' );
|
|
like( $DBI::errstr, qr/column a is not unique|UNIQUE constraint failed/, '$DBI::errstr ok' );
|