1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 06:08:38 -04:00
DBD-SQLite-SQLcipher/t/52_db_filename.t
2019-01-06 09:03:41 +09:00

35 lines
583 B
Perl

use strict;
use warnings;
use lib "t/lib";
use SQLiteTest qw/connect_ok @CALL_FUNCS requires_sqlite/;
use Test::More;
BEGIN { requires_sqlite('3.7.10') }
use Test::NoWarnings;
for my $func (@CALL_FUNCS) {
{
my $db = filename($func);
ok !$db, "in-memory database";
}
{
my $db = filename($func, dbfile => '');
ok !$db, "temporary database";
}
{
my $db = filename($func, dbfile => 'test.db');
like $db => qr/test\.db[\d]*$/i, "test.db";
unlink $db;
}
}
sub filename {
my $func = shift;
my $dbh = connect_ok(@_);
$dbh->$func('db_filename');
}
done_testing;