tests: Localize config setting

This isn't strictly necessary, but is good practice because it
guarantees that the config is cleaned up after each test case.
This commit is contained in:
Richard Hansen 2025-01-08 03:00:41 -05:00
parent 8decfc4b77
commit 3f3b8cf825

View file

@ -73,7 +73,7 @@ for my $tc (@test_cases) {
SKIP: {
skip("IPv6 not supported on this system", 1) if $tc->{ipv6} && !$ipv6_supported;
skip("HTTP::Daemon too old for IPv6 support", 1) if $tc->{ipv6} && !$httpd_ipv6_supported;
$ddclient::config{$h} = $tc->{cfg};
local $ddclient::config{$h} = $tc->{cfg};
%ddclient::config if 0; # suppress spurious warning "Name used only once: possible typo"
is(ddclient::get_ipv4(ddclient::strategy_inputs('usev4', $h)), $tc->{want}, $tc->{desc})
if ($tc->{cfg}{usev4});