1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00
DBD-SQLite-SQLcipher/t/02_logon.t
Adam Kennedy 09f58b864d - Adding support parsing attributes out of the DSN (ADAMK)
- Dropping support for uncode before 5.8.5 to simplify support and
      to prevent people hurting themselves on platforms that don't
      properly support Unicode anyway (ADAMK)
2009-04-10 06:09:31 +00:00

34 lines
842 B
Perl

#!/usr/bin/perl
# Tests basic login and pragma setting
use strict;
BEGIN {
$| = 1;
$^W = 1;
}
use t::lib::Test;
use Test::More tests => 9;
use Test::NoWarnings;
# Ordinary connect
SCOPE: {
my $dbh = connect_ok();
ok( $dbh->{sqlite_version}, '->{sqlite_version} ok' );
is( $dbh->{AutoCommit}, 1, 'AutoCommit is on by default' );
diag("sqlite_version=$dbh->{sqlite_version}");
ok( $dbh->func('busy_timeout'), 'Found initial busy_timeout' );
ok( $dbh->func(5000, 'busy_timeout') );
is( $dbh->func('busy_timeout'), 5000, 'Set busy_timeout to new value' );
}
# Attributes in the connect string
SKIP: {
unless ( $] >= 5.008005 ) {
skip( 'Unicode is not supported before 5.8.5', 2 );
}
my $dbh = DBI->connect( 'dbi:SQLite:dbname=foo;unicode=1', '', '' );
isa_ok( $dbh, 'DBI::db' );
is( $dbh->{unicode}, 1, 'Unicode is on' );
}