mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 22:28:47 -04:00
fix test with non-latin characters in path
This commit is contained in:
parent
bfefa7ab3b
commit
84aa375f45
1 changed files with 13 additions and 5 deletions
|
@ -16,18 +16,26 @@ use Test::NoWarnings;
|
||||||
use File::Temp qw(tempdir);
|
use File::Temp qw(tempdir);
|
||||||
use File::Spec::Functions qw(catdir catfile);
|
use File::Spec::Functions qw(catdir catfile);
|
||||||
|
|
||||||
my @subdirs = ('database', 'adatbázis');
|
my @words = ('database', 'adatbázis');
|
||||||
plan tests => 1 + @subdirs * 2;
|
plan tests => 1 + @words * 3;
|
||||||
|
|
||||||
my $dir = tempdir( CLEANUP => 1 );
|
my $dir = tempdir( CLEANUP => 1 );
|
||||||
|
|
||||||
foreach my $subdir (@subdirs) {
|
foreach my $subdir (@words) {
|
||||||
ok(mkdir(catdir($dir, $subdir)), "$subdir created");
|
ok(mkdir(catdir($dir, $subdir)), "subdir $subdir created");
|
||||||
my $dbfile = catfile($dir, $subdir, 'db.db');
|
my $dbfile = catfile($dir, $subdir, 'db.db');
|
||||||
eval {
|
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 $@;
|
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 $@;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue