[pve-devel] [PATCH installer 2/2] tests: prevent uninitialized value warning with undef as fqdn

Stoiko Ivanov s.ivanov at proxmox.com
Tue Apr 30 17:18:47 CEST 2024


cosmetic issue - but was distracting enough to make me look if there's
an error.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 test/parse-fqdn.pl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/parse-fqdn.pl b/test/parse-fqdn.pl
index 6638fbe..47e0e21 100755
--- a/test/parse-fqdn.pl
+++ b/test/parse-fqdn.pl
@@ -24,9 +24,10 @@ sub is_parsed {
 sub is_invalid {
     my ($fqdn, $expected_err) = @_;
 
+    my $print_fqdn = $fqdn // '(undefined)';
     my $parsed = eval { parse_fqdn($fqdn) };
-    is($parsed, undef, "invalid FQDN did fail parsing: $fqdn");
-    is($@, $expected_err, "invalid FQDN threw correct error: $fqdn");
+    is($parsed, undef, "invalid FQDN did fail parsing: $print_fqdn");
+    is($@, $expected_err, "invalid FQDN threw correct error: $print_fqdn");
 }
 
 is_invalid(undef, ERR_EMPTY);
-- 
2.39.2





More information about the pve-devel mailing list