1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 22:28:47 -04:00
DBD-SQLite-SQLcipher/t/06error.t
Adam Kennedy a3ff0b1f7c All tests run under the same Perl environment
(autoflush on, and warnings enabled via $^W = 1)
2009-04-03 14:25:58 +00:00

29 lines
556 B
Perl

#!/usr/bin/perl
use strict;
BEGIN {
$| = 1;
$^W = 1;
}
use Test::More tests => 2;
use DBI;
unlink('foo');
my $db = DBI->connect('dbi:SQLite:foo', '', '', { RaiseError => 1, PrintError => 0 });
eval {
$db->do('ssdfsdf sdf sd sdfsdfdsf sdfsdf');
};
ok($@);
$db->do('create table testerror (a, b)');
$db->do('insert into testerror values (1, 2)');
$db->do('insert into testerror values (3, 4)');
$db->do('create unique index testerror_idx on testerror (a)');
eval {
$db->do('insert into testerror values (1, 5)');
};
ok($@);
END { unlink 'foo' }