Skip to content

Commit

Permalink
CAF::Path: fix verify_exceptions() in path.t
Browse files Browse the repository at this point in the history
- Protect against uninitialized variables
- Clarify messages
  • Loading branch information
jouvin committed Mar 7, 2017
1 parent 49e3b2c commit dcf78c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/perl/path.t
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ sub verify_exception
{
my ($msg, $fail, $expected_reset, $noreset) = @_;
$expected_reset = 1 if (! defined($expected_reset));
is($exception_reset, $expected_reset, "exception_reset called $expected_reset after $msg");
is($exception_reset, $expected_reset, "_reset_exception_fail called $expected_reset times after $msg");
if ($noreset) {
ok($ec_check->error(), "Error not reset after $msg");
} else {
ok(! $ec_check->error(), "Error reset after $msg");
};
if ($noreset) {
if ($noreset && $mc->{fail}) {
like($mc->{fail}, qr{^origfailure }, "Fail attribute matches originalfailure on noreset after $msg");
} elsif ($fail) {
} elsif ($fail && $mc->{fail}) {
like($mc->{fail}, qr{$fail}, "Fail attribute matches $fail after $msg");
unlike($mc->{fail}, qr{origfailure}, "original fail attribute reset");
} else {
} elsif ( ! $noreset ) {
ok(! defined($mc->{fail}), "Fail attribute reset after $msg");
};
};
Expand Down

0 comments on commit dcf78c8

Please sign in to comment.