On Tue Sep 08 15:45:01 2015, SREZIC wrote:
Show quoted text> On 2015-08-28 19:22:47, SREZIC wrote:
> > On 2015-07-20 18:36:24, SREZIC wrote:
> > > With perl 5.23.1 the 01-basics.t test fails:
> > >
> > > # Failed test '<%*1$.*f> = <4.0000>'
> > > # at t/01-basics.t line 60.
> > > # got: '<5.0000>'
> > > # expected: '<4.0000>'
> > > Invalid conversion in sprintf: "%(" at /tmpfs/.cpan-
> > > build/2015072021/Text-sprintfn-0.07-M4n2IM/blib/lib/Text/sprintfn.pm
> > > line 69.
> > > Redundant argument in sprintf at /tmpfs/.cpan-build/2015072021/Text-
> > > sprintfn-0.07-M4n2IM/blib/lib/Text/sprintfn.pm line 69.
> > > # Looks like you failed 1 test of 31.
> > > t/01-basics.t .............
> > > Dubious, test returned 1 (wstat 256, 0x100)
> > > Failed 1/31 subtests
> > >
> > > Early 5.23.1 versions did not had this problem:
> > >
http://matrix.cpantesters.org/?dist=Text-
> > > sprintfn;os=linux;perl=5.23.1;reports=1#sl=6,0
> > > So it's possible this is a regression in perl itself (@Andreas: looks
> > > like a bisect candidate).
> >
> > Fails also with 5.23.2.
> >
>
> See also the discussion at rt.perl.org:
>
https://rt.perl.org/Public/Bug/Display.html?id=125956
In RT #125956, we concluded that the problem reported in *this* bug ticket were consistent with the changes in sprintf introduced earlier in the perl5 release cycle. Hence, the code built on top of perl5 must change.
I am attaching a patch to t/01-basics.t which corrects the test failure and eliminates all but one of the warnings with which the test was displaying when run against blead.
Thank you very much.
Jim Keenan
--- t/01-basics.t.orig 2015-09-14 18:52:11.895419722 -0400
+++ t/01-basics.t 2015-09-14 19:09:46.255398207 -0400
@@ -11,20 +11,20 @@
# [fmt, args, res], ...
my @tests = (
# no named, must be same as sprintf
- ['<%%>', [4, 5], "<%>"], # %%
- ['<%d>', [4, 5], "<4>"], # simple
- ['<% 4d>', [4, 5], "< 4>"], # flag (1)
- ['<% +4d>', [4, 5], "< +4>"], # flag (2)
+ ['<%%>', [], "<%>"], # %%
+ ['<%d>', [4], "<4>"], # simple
+ ['<% 4d>', [4], "< 4>"], # flag (1)
+ ['<% +4d>', [4], "< +4>"], # flag (2)
['<%vd>', ["ABC"], "<65.66.67>"], # vector flag (1)
['<%*vd>', [":", "ABC"], "<65:66:67>"], # vector flag (2)
- ['<%04d>', [4, 5], "<0004>"], # width
- ['<%-5d>', [-4, 5], "<-4 >"], # width (2, negative)
+ ['<%04d>', [4], "<0004>"], # width
+ ['<%-5d>', [-4], "<-4 >"], # width (2, negative)
['<%*d>', [4, 5], "< 5>"], # width *
['<%*d> <%d>', [4, 5, 6], "< 5> <6>"], # width * (2)
- ['<%5.2f>', [4, 5], "< 4.00>"], # width + precision
+ ['<%5.2f>', [4], "< 4.00>"], # width + precision
['<%*.2f>', [4, 5], "<5.00>"], # width + precision (2)
['<%*.*f>', [4, 5, 6], "<6.00000>"], # width + precision (3)
- ['<%*1$.*f>', [4, 5, 10], "<4.0000>"], # width + precision (4)
+ ['<%*1$.*f>', [4, 5, 10], "<5.0000>"], # width + precision (4)
['<%2$d>', [-4, 5], "<5>"], # param index
['<%2$-3d> <%.*f> <%d>', [4, 5, 6, 7], "<5 > <5.0000> <6>"], # combo (1)