Check that vars are defined before using them as hashrefs.

This commit is contained in:
Daniel Nichter
2012-07-19 15:33:27 -06:00
parent 97a8ba9518
commit c71f3b15e1
5 changed files with 46 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 10;
plan tests => 13;
}
my $output;
@@ -107,6 +107,35 @@ ok(
"Bug 894140"
);
# #############################################################################
# --key-types
# https://bugs.launchpad.net/percona-toolkit/+bug/969669
# #############################################################################
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args,
qw(-d sakila --key-types k)) },
"$sample/key-types-k.txt"),
'--key-types k'
);
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args,
qw(-d sakila --key-types f)) },
"$sample/key-types-f.txt"),
'--key-types f'
);
ok(
no_diff(
sub { pt_duplicate_key_checker::main(@args,
qw(-d sakila --key-types fk)) },
"$sample/key-types-fk.txt"),
'--key-types fk (explicit)'
);
# #############################################################################
# Done.
# #############################################################################