Logger: Minimize STDERR override in tests
This commit is contained in:
parent
dff4cd4854
commit
439b0fd0e1
1 changed files with 4 additions and 2 deletions
|
@ -149,10 +149,12 @@ my @logfmt_test_cases = (
|
||||||
for my $tc (@logfmt_test_cases) {
|
for my $tc (@logfmt_test_cases) {
|
||||||
my $got;
|
my $got;
|
||||||
open(my $fh, '>', \$got);
|
open(my $fh, '>', \$got);
|
||||||
local *STDERR = $fh;
|
|
||||||
local $ddclient::globals{debug} = 1;
|
local $ddclient::globals{debug} = 1;
|
||||||
%ddclient::globals if 0;
|
%ddclient::globals if 0;
|
||||||
|
{
|
||||||
|
local *STDERR = $fh;
|
||||||
ddclient::debug(@{$tc->{args}});
|
ddclient::debug(@{$tc->{args}});
|
||||||
|
}
|
||||||
close($fh);
|
close($fh);
|
||||||
is($got, $tc->{want}, $tc->{desc});
|
is($got, $tc->{want}, $tc->{desc});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue