1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

fix test with non-latin characters in path

This commit is contained in:
Gábor Szabó 2009-04-15 14:01:34 +00:00
parent bfefa7ab3b
commit 84aa375f45

View file

@ -16,18 +16,26 @@ use Test::NoWarnings;
use File::Temp qw(tempdir);
use File::Spec::Functions qw(catdir catfile);
my @subdirs = ('database', 'adatbázis');
plan tests => 1 + @subdirs * 2;
my @words = ('database', 'adatbázis');
plan tests => 1 + @words * 3;
my $dir = tempdir( CLEANUP => 1 );
foreach my $subdir (@subdirs) {
ok(mkdir(catdir($dir, $subdir)), "$subdir created");
foreach my $subdir (@words) {
ok(mkdir(catdir($dir, $subdir)), "subdir $subdir created");
my $dbfile = catfile($dir, $subdir, 'db.db');
eval {
DBI->connect("dbi:SQLite:dbname=$dbfile");
DBI->connect("dbi:SQLite:dbname=$dbfile", "", "", {RaiseError => 1, PrintError => 0});
};
ok(!$@, "Could connect to database in $subdir") or diag $@;
# when the name of the database file has non-latin characters
my $dbfilex = catfile($dir, "$subdir.db");
eval {
DBI->connect("dbi:SQLite:dbname=$dbfilex", "", "", {RaiseError => 1, PrintError => 0});
};
ok(!$@, "Could connect to database in $dbfilex") or diag $@;
}