Skip Menu |

This queue is for tickets about the BSD-getloadavg CPAN distribution.

Report information
The Basics
Id: 110463
Status: new
Priority: 0/
Queue: BSD-getloadavg

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: (no value)



Subject: t/BSD-getloadavg.t fails if a non-dot number is returned
I see fails like this (also visible at CPAN Testers, see http://analysis.cpantesters.org/reports_by_field?distv=BSD-getloadavg-0.03;field=qr%3A%28Failed%20test\s%2B\S%2B.*%29 ): # You named your test '1'. You shouldn't use numbers for your test names. # Very confusing. # Failed test '1' # at t/BSD-getloadavg.t line 14. # '1' # doesn't match '(?^:^(0|\d+\.\d+)$)' # Looks like you failed 1 test of 5. t/BSD-getloadavg.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/5 subtests Probably the regexp in the test should be changed to something like qr/^(0|\d+(?:\.\d+)?)$/ Or alternatively use looks_like_number from Scalar::Util.
On 2015-12-20 02:23:37, SREZIC wrote: Show quoted text
> I see fails like this (also visible at CPAN Testers, see > http://analysis.cpantesters.org/reports_by_field?distv=BSD-getloadavg- > 0.03;field=qr%3A%28Failed%20test\s%2B\S%2B.*%29 ): > > # You named your test '1'. You shouldn't use numbers for your > test names. > # Very confusing. > > # Failed test '1' > # at t/BSD-getloadavg.t line 14. > # '1' > # doesn't match '(?^:^(0|\d+\.\d+)$)' > # Looks like you failed 1 test of 5. > t/BSD-getloadavg.t .. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/5 subtests > > Probably the regexp in the test should be changed to something like > qr/^(0|\d+(?:\.\d+)?)$/ > Or alternatively use looks_like_number from Scalar::Util.
And additionally the test name should have some text to avoid the Test::More/Builder warning. Maybe something like "1min loadavg is $loadavg[0]".