Logger: Minimize STDERR override in tests

This commit is contained in:
Richard Hansen 2024-08-02 16:29:21 -04:00
parent dff4cd4854
commit 439b0fd0e1

View file

@ -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});
} }