Author: hmbrand
Date: Mon May 24 02:14:29 2010
New Revision: 14019
Modified:
dbi/trunk/MANIFEST
dbi/trunk/t/49dbd_file.t
Log:
Fix layer test
Modified: dbi/trunk/MANIFEST
==============================================================================
--- dbi/trunk/MANIFEST (original)
+++ dbi/trunk/MANIFEST Mon May 24 02:14:29 2010
@@ -90,6 +90,7 @@
t/41prof_dump.t
t/42prof_data.t
t/43prof_env.t
+t/49dbd_file.t
t/50dbm_simple.t
t/60preparse.t
t/65transact.t
Modified: dbi/trunk/t/49dbd_file.t
==============================================================================
--- dbi/trunk/t/49dbd_file.t (original)
+++ dbi/trunk/t/49dbd_file.t Mon May 24 02:14:29 2010
@@ -62,19 +62,17 @@
like ("@msg", qr{Cannot open ./t_sbdgf_}, "Cannot open non-existing file");
}
-my $tfh;
+my @tfhl;
# Now test some basic SQL statements
my $tbl_file = "$tbl.txt";
ok ($dbh->do ("create table $tbl (txt varchar (20))"), "Create table $tbl");
ok (-f $tbl_file, "Test table exists");
-if ($tfh) { # push_names () cached the now opened file handle
- # Expected: ("unix", "perlio", "encoding(iso-8859-1)")
- # use Data::Peek; DDumper [ PerlIO::get_layers ($tfh) ];
- my @layer = grep { $_ eq "encoding($encoding)" } PerlIO::get_layers ($tfh);
- is (scalar @layer, 1, "encoding shows in layer");
- }
+# Expected: ("unix", "perlio", "encoding(iso-8859-1)")
+# use Data::Peek; DDumper [ @tfh ];
+my @layer = grep { $_ eq "encoding($encoding)" } @tfhl;
+is (scalar @layer, 1, "encoding shows in layer");
ok ($sth = $dbh->prepare ("select * from $tbl"), "Prepare select *");
$rowidx = 0;
@@ -106,6 +104,6 @@
{
my ($self, $data, $row_aryref) = @_;
my $meta = $self->{meta};
- $tfh = $meta->{fh};
+ @tfhl = PerlIO::get_layers ($meta->{fh});
@{$meta->{col_names}} = @{$row_aryref};
} # push_names
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.