Fix RawLogParser.t. Use diag in PerconaTest.pm.

This commit is contained in:
Daniel Nichter
2012-10-20 13:32:12 -06:00
parent 85a0616ec3
commit be50548f3b
2 changed files with 8 additions and 7 deletions

View File

@@ -386,7 +386,7 @@ sub test_log_parser {
\@e,
$args{result},
"$base_file_name: results"
) or print "Got: ", Dumper(\@e);
) or diag(Dumper(\@e));
}
if ( defined $args{num_events} ) {
@@ -443,7 +443,7 @@ sub test_protocol_parser {
\@e,
$args{result},
"$base_file_name: " . ($args{desc} || "results")
) or print "Got: ", Dumper(\@e);
) or diag(Dumper(\@e));
}
if ( defined $args{num_events} ) {
@@ -496,7 +496,7 @@ sub test_packet_parser {
$args{result},
"$args{file}" . ($args{desc} ? ": $args{desc}" : '')
) ) {
print Dumper(\@packets);
diag(Dumper(\@packets));
}
return;
@@ -601,7 +601,7 @@ sub no_diff {
diag($out);
if ( $ENV{UPDATE_SAMPLES} || $args{update_sample} ) {
`cat $tmp_file > $expected_output`;
print STDERR "Updated $expected_output\n";
diag("Updated $expected_output");
}
}

View File

@@ -9,7 +9,7 @@ BEGIN {
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More tests => 3;
use Test::More;
use RawLogParser;
use PerconaTest;
@@ -25,13 +25,13 @@ test_log_parser(
oktorun => sub { $oktorun = $_[0]; },
result => [
{ pos_in_log => 0,
args => 'SELECT c FROM t WHERE id=1',
arg => 'SELECT c FROM t WHERE id=1',
bytes => 26,
cmd => 'Query',
Query_time => 0,
},
{ pos_in_log => 27,
args => '/* Hello, world! */ SELECT * FROM t2 LIMIT 1',
arg => '/* Hello, world! */ SELECT * FROM t2 LIMIT 1',
bytes => 44,
cmd => 'Query',
Query_time => 0,
@@ -49,4 +49,5 @@ $oktorun = 1;
# #############################################################################
# Done.
# #############################################################################
done_testing;
exit;