"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/19fhtrace.t" between
DBI-1.642.tar.gz and DBI-1.643.tar.gz

About: DBI - The Perl Database Interface (requires one or more "driver" modules DBD::* to talk to databases).

19fhtrace.t  (DBI-1.642):19fhtrace.t  (DBI-1.643)
skipping to change at line 159 skipping to change at line 159
1; 1;
package main; package main;
## ---------------------------------------------------------------------------- ## ----------------------------------------------------------------------------
# Connect to the example driver. # Connect to the example driver.
my $dbh = DBI->connect('dbi:ExampleP:dummy', '', '', my $dbh = DBI->connect('dbi:ExampleP:dummy', '', '',
{ PrintError => 0, { PrintError => 0,
RaiseError => 1, RaiseError => 1,
PrintWarn => 1, PrintWarn => 0,
RaiseWarn => 1,
}); });
isa_ok( $dbh, 'DBI::db' ); isa_ok( $dbh, 'DBI::db' );
# Clean up when we're done. # Clean up when we're done.
END { $dbh->disconnect if $dbh }; END { $dbh->disconnect if $dbh };
## ---------------------------------------------------------------------------- ## ----------------------------------------------------------------------------
# Check the database handle attributes. # Check the database handle attributes.
cmp_ok($dbh->{TraceLevel}, '==', $DBI::dbi_debug & 0xF, '... checking TraceLevel attribute'); cmp_ok($dbh->{TraceLevel}, '==', $DBI::dbi_debug & 0xF, '... checking TraceLevel attribute');
skipping to change at line 236 skipping to change at line 237
DBI->trace_msg ("foo\n", 1); DBI->trace_msg ("foo\n", 1);
DBI->trace (0, *STDERR); DBI->trace (0, *STDERR);
close FOO; close FOO;
open my $fh, "<", $tf; open my $fh, "<", $tf;
is ((<$fh>)[-1], "foo\n", "Traced message"); is ((<$fh>)[-1], "foo\n", "Traced message");
close $fh; close $fh;
is (-f "*main::STDERR", undef, "Regression test"); is (-f "*main::STDERR", undef, "Regression test");
1 while unlink $tf; 1 while unlink $tf;
} }
SKIP: {
eval { require 5.008; };
skip "Layered I/O not available in Perl $^V", 13
if $@;
## ---------------------------------------------------------------------------- ## ----------------------------------------------------------------------------
# Then use layered filehandle # Then use layered filehandle
# #
open TRACEFD, '+>:via(TraceDBI)', 'layeredtrace.out'; open TRACEFD, '+>:via(TraceDBI)', 'layeredtrace.out';
print TRACEFD "*** Test our layer\n"; print TRACEFD "*** Test our layer\n";
my $result = <TRACEFD>; my $result = <TRACEFD>;
is $result, "*** Test our layer\n", "... layered fh: file is layered: $result \n"; is $result, "*** Test our layer\n", "... layered fh: file is layered: $result \n";
$dbh->trace(1, \*TRACEFD); $dbh->trace(1, \*TRACEFD);
ok( 1, '... layered fh: filehandle successfully set'); ok( 1, '... layered fh: filehandle successfully set');
skipping to change at line 302 skipping to change at line 299
ok 1, "... logger: trace_msg\n"; ok 1, "... logger: trace_msg\n";
$dbh->trace(1, "STDOUT"); # close $trace_file $dbh->trace(1, "STDOUT"); # close $trace_file
ok 1, "... logger: close doesn't close\n"; ok 1, "... logger: close doesn't close\n";
$dbh->trace_msg("Next logline\n", 1); $dbh->trace_msg("Next logline\n", 1);
ok 1, "... logger: trace_msg after change trace output\n"; ok 1, "... logger: trace_msg after change trace output\n";
close $fh; close $fh;
}
1; 1;
# end # end
 End of changes. 3 change blocks. 
7 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)