Skip to content

Commit dcf78c8

Browse files
committed
CAF::Path: fix verify_exceptions() in path.t
- Protect against uninitialized variables - Clarify messages
1 parent 49e3b2c commit dcf78c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/perl/path.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,18 @@ sub verify_exception
102102
{
103103
my ($msg, $fail, $expected_reset, $noreset) = @_;
104104
$expected_reset = 1 if (! defined($expected_reset));
105-
is($exception_reset, $expected_reset, "exception_reset called $expected_reset after $msg");
105+
is($exception_reset, $expected_reset, "_reset_exception_fail called $expected_reset times after $msg");
106106
if ($noreset) {
107107
ok($ec_check->error(), "Error not reset after $msg");
108108
} else {
109109
ok(! $ec_check->error(), "Error reset after $msg");
110110
};
111-
if ($noreset) {
111+
if ($noreset && $mc->{fail}) {
112112
like($mc->{fail}, qr{^origfailure }, "Fail attribute matches originalfailure on noreset after $msg");
113-
} elsif ($fail) {
113+
} elsif ($fail && $mc->{fail}) {
114114
like($mc->{fail}, qr{$fail}, "Fail attribute matches $fail after $msg");
115115
unlike($mc->{fail}, qr{origfailure}, "original fail attribute reset");
116-
} else {
116+
} elsif ( ! $noreset ) {
117117
ok(! defined($mc->{fail}), "Fail attribute reset after $msg");
118118
};
119119
};

0 commit comments

Comments
 (0)