+my $test_db = 'fusedbi.db';
+my $dsn = "DBI:SQLite:dbname=$test_db";
+my $mount = '/tmp/fuse_dbi_mnt';
+
+ok((! -e $test_db || unlink $test_db), "test db: $test_db");
+
+ok((! -e $mount || rmdir $mount), "mount point $mount");
+
+mkdir $mount || die "mkdir $mount: $!";
+ok(-d $mount, "mkdir $mount");
+
+ok(my $dbh = DBI->connect($dsn, , '', '', { RaiseError => 1 }),
+ "connect fusedbi test database");
+
+ok($dbh->do(qq{
+ create table files (
+ name text primary key,
+ data text
+ )
+}), "create table files");
+
+ok(my $sth = $dbh->prepare(qq{
+ insert into files (name,data) values (?,?)
+}), "prepare");
+
+foreach my $file (qw(file dir/file dir/subdir/file)) {
+ my $data = "this is test data\n" x length($file);
+ ok($sth->execute($file,$data), "insert $file");
+}
+
+my $sql_filenames = qq{