in reply to Sign bug in Number::Format

I believe Devel::DumpTrace quickly identifies the root cause of the problem.
perl -d:DumpTrace=+Number::Format -MNumber::Format -E 'say Number::For +mat::format_number(-0.00004, 5)' >>> -e:1:[__top__]: say Number::Format::format_number(-0.00004, 5 +) >>> Number/Format.pm:316:[_get_self]: unless (ref $_:(-4e-05,5)[0 +] && UNIVERSAL::isa($_:(-4e-05,5)[0], "Number::Format"))

It seems that perl immediately interprets the value passed to the function (-0.00004) as scientific notation inside the function (-4e-05). A diff of this output vs. the output of a passing case with one less zero (-0.0004) shows where in the code the 2 cases diverge. I uploaded a patch to the open bug report.

It then occurred to me to take a look a the coverage results (cpancover.com: new web site for CPAN code coverage). Sure enough, the line of code I patched was not covered by the test suite. This shows the value in using coverage to determine test quality.

Why did I delay posting this? I tried using Devel::DumpTrace shortly after the original posting, but it did not give me the result I expected. It dawned on me that I may not have the latest version of the module. A quick check of CPAN showed that the attentive author had uploaded several versions newer than what I had installed (it is a fairly young module).

I installed the latest version, and the results were a little better, but still not what I expected. I submitted a bug report, and as it turned out, Number::Format sensitized a bug in Devel::DumpTrace! Within a few hours, the author identified the root cause, and uploaded a fixed version the next day. Kudos to the author.

Morals of this story: