moved sqlite test to 02sqlite.t
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 2 Oct 2004 00:42:27 +0000 (00:42 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 2 Oct 2004 00:42:27 +0000 (00:42 +0000)
git-svn-id: svn://svn.rot13.org/fuse_dbi/trunk@19 17f4e80c-d0e0-0310-8903-bfc3ae804c12

t/02database.t [deleted file]
t/02sqlite.t [new file with mode: 0755]

diff --git a/t/02database.t b/t/02database.t
deleted file mode 100755 (executable)
index a0df6f0..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use warnings;
-
-use Test::More;
-use blib;
-
-eval "use DBD::SQLite";
-plan skip_all => "DBD::SQLite required for testing" if $@;
-plan tests => 14;
-
-use_ok('DBI');
-use_ok('Fuse::DBI');
-
-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{
-       select
-               name as id,
-               name as filename,
-               length(data) as size,
-               1 as writable
-       from files
-};
-
-my $sql_read = qq{
-       select data
-               from files
-               where name = ?;
-};
-
-my $sql_update = qq{
-       update files
-               set data = ?    
-               where name = ?;
-};
-
-system "fusermount -q -u $mount" || diag "nothing mounted at $mount, ok";
-
-my $mnt = Fuse::DBI->mount({
-       filenames => $sql_filenames,
-       read => $sql_read,
-       update => $sql_update,
-       dsn => $dsn,
-       mount => $mount,
-});
-
-ok($mnt, "mount");
-
-diag "press enter to continue";
-my $foo = <STDIN>;
-
-ok($mnt->umount,"umount");
-
-ok(unlink $test_db,"rm $test_db");
-
diff --git a/t/02sqlite.t b/t/02sqlite.t
new file mode 100755 (executable)
index 0000000..a0df6f0
--- /dev/null
@@ -0,0 +1,85 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use Test::More;
+use blib;
+
+eval "use DBD::SQLite";
+plan skip_all => "DBD::SQLite required for testing" if $@;
+plan tests => 14;
+
+use_ok('DBI');
+use_ok('Fuse::DBI');
+
+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{
+       select
+               name as id,
+               name as filename,
+               length(data) as size,
+               1 as writable
+       from files
+};
+
+my $sql_read = qq{
+       select data
+               from files
+               where name = ?;
+};
+
+my $sql_update = qq{
+       update files
+               set data = ?    
+               where name = ?;
+};
+
+system "fusermount -q -u $mount" || diag "nothing mounted at $mount, ok";
+
+my $mnt = Fuse::DBI->mount({
+       filenames => $sql_filenames,
+       read => $sql_read,
+       update => $sql_update,
+       dsn => $dsn,
+       mount => $mount,
+});
+
+ok($mnt, "mount");
+
+diag "press enter to continue";
+my $foo = <STDIN>;
+
+ok($mnt->umount,"umount");
+
+ok(unlink $test_db,"rm $test_db");
+