diff options
| author | Ton Voon <tonvoon@users.sourceforge.net> | 2008-02-01 09:30:43 +0000 | 
|---|---|---|
| committer | Ton Voon <tonvoon@users.sourceforge.net> | 2008-02-01 09:30:43 +0000 | 
| commit | 6e6a17bf2921f7c5d8ebcd103d42dc70ad9cbb35 (patch) | |
| tree | bfa872d9e0409631d24b9d9867a717b0fbd99608 | |
| parent | 597dbf782b17156025cba2be7bbcb22628bc8542 (diff) | |
| download | monitoring-plugin-perl-6e6a17bf2921f7c5d8ebcd103d42dc70ad9cbb35.tar.gz | |
Fixed a test where a fractional number was stripped out
of the hash key, causing test failures
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1921 f882894a-f735-0410-b71e-b25c423dba1c
| -rw-r--r-- | Changes | 3 | ||||
| -rw-r--r-- | t/Nagios-Plugin-Range.t | 9 | 
2 files changed, 10 insertions, 2 deletions
| @@ -1,5 +1,8 @@ | |||
| 1 | Revision history for Perl module Nagios::Plugin. | 1 | Revision history for Perl module Nagios::Plugin. | 
| 2 | 2 | ||
| 3 | 0.24 1st February 2008 | ||
| 4 | - Fixed a test failure which highlighted a precision rounding within hashes | ||
| 5 | |||
| 3 | 0.23 18th December 2007 | 6 | 0.23 18th December 2007 | 
| 4 | - Use $^X for perl in check_stuff.t test, due to lots of failing in CPAN Testers | 7 | - Use $^X for perl in check_stuff.t test, due to lots of failing in CPAN Testers | 
| 5 | 8 | ||
| diff --git a/t/Nagios-Plugin-Range.t b/t/Nagios-Plugin-Range.t index 9b75a13..6fe080c 100644 --- a/t/Nagios-Plugin-Range.t +++ b/t/Nagios-Plugin-Range.t | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | use strict; | 2 | use strict; | 
| 3 | #use Test::More qw(no_plan); | 3 | #use Test::More qw(no_plan); | 
| 4 | use Test::More tests => 149; | 4 | use Test::More tests => 151; | 
| 5 | 5 | ||
| 6 | BEGIN { | 6 | BEGIN { | 
| 7 | use_ok('Nagios::Plugin::Range'); | 7 | use_ok('Nagios::Plugin::Range'); | 
| @@ -157,8 +157,13 @@ $expected = { | |||
| 157 | -95.999 => 1, | 157 | -95.999 => 1, | 
| 158 | -1 => 1, | 158 | -1 => 1, | 
| 159 | 0 => 1, | 159 | 0 => 1, | 
| 160 | 123456789012344.91 => 1, | 160 | # The fractional values needs to be quoted, otherwise the hash rounds it up to ..345 | 
| 161 | # and there is one less test run. | ||
| 162 | # I think some newer versions of perl use a higher precision value for the hash key. | ||
| 163 | # This doesn't appear to affect the actual plugin though | ||
| 164 | "123456789012344.91" => 1, | ||
| 161 | 123456789012345 => 0, | 165 | 123456789012345 => 0, | 
| 166 | "123456789012345.61" => 0, | ||
| 162 | 123456789012346 => 0, | 167 | 123456789012346 => 0, | 
| 163 | }; | 168 | }; | 
| 164 | test_expected( $r, $expected ); | 169 | test_expected( $r, $expected ); | 
