Subject: | t/03_binary_version.t may fail (with newer perls) |
On a smoker machine I see the following error:
...
# Failed test '`makeinfo --version` 1 line of output is correct'
# at t/03_binary_version.t line 34.
Use of uninitialized value $1 in split at t/03_binary_version.t line 37.
Use of uninitialized value in addition (+) at t/03_binary_version.t line 38.
# Failed test '`makeinfo --version` returns major version 4 or newer'
# at t/03_binary_version.t line 39.
# '0'
# >=
# '4'
# Looks like you failed 2 tests of 6.
t/03_binary_version.t ........
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/6 subtests
...
One problem is missing diagnostics here --- it's better to use "like" instead of "ok":
diff --git a/t/03_binary_version.t b/t/03_binary_version.t
index 9383b92..5b35383 100644
--- a/t/03_binary_version.t
+++ b/t/03_binary_version.t
@@ -31,7 +31,7 @@ cmp_ok((scalar @{$version}), '>=', 1, '`makeinfo --version` executes with at lea
# EXAMPLE: makeinfo (GNU texinfo) 5.2
my $version_0 = $version->[0];
#print {*STDERR} 'in 03_binary_version.t, have $version_0 = ', "\n", '[[[', $version_0, ']]]', "\n";
-ok($version_0 =~ m/^\w+\ \(GNU\ texinfo\)\ ([0-9\.]+)$/xms, '`makeinfo --version` 1 line of output is correct');
+like($version_0, qr/^\w+\ \(GNU\ texinfo\)\ ([0-9\.]+)$/xms, '`makeinfo --version` 1 line of output is correct');
# DEV NOTE, CORRELATION #at000: require Texinfo v4.x or newer, as of 20171216 Candl uses Texinfo v4.11 & at least 10% of CPAN Testers has Texinfo v4.x
my $version_split = [split /[.]/, $1];
With this patch I see:
# Failed test '`makeinfo --version` 1 line of output is correct'
# at t/03_binary_version.t line 34.
# 'Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^\s+@([[:alnum:]][[:alnum:]\-]*)({ <-- HERE })?\s*/ at /usr/home/cpansand/.cpan/build/2019042709/Alien-Texinfo-0.005000-0/blib/lib/auto/share/dist/Alien-Texinfo/bin/../share/texinfo/Texinfo/Parser.pm line 5481.'
# doesn't match '(?^msx:^\w+\ \(GNU\ texinfo\)\ ([0-9\.]+)$)'
So it seems that the module here needs some patching, i.e. escaping the curly braces in the regexp.