5 use Test::More tests => 4;
9 open(FILE, "t/27_filehandle.t.db") || die("Can't open t/27_filehandle.t.db\n");
13 # test if we can open and read a db using its filehandle
15 ok(($db = DBM::Deep->new(fh => *FILE)), "open db in filehandle");
16 ok($db->{hash}->{foo}->[1] eq 'b', "and get at stuff in the database");
21 # now the same, but with an offset into the file. Use the database that's
22 # embedded in the test for the DATA filehandle. First, find the database ...
23 open(FILE, "t/28_DATA.t") || die("Can't open t/28_DATA.t\n");
24 while(my $line = <FILE>) {
25 last if($line =~ /^__DATA__/);
27 my $offset = tell(FILE);
30 open(FILE, "t/28_DATA.t");
31 ok(($db = DBM::Deep->new(fh => *FILE, file_offset => $offset)), "open db in filehandle with offset");
32 ok($db->{hash}->{foo}->[1] eq 'b', "and get at stuff in the database");