From 6e6a17bf2921f7c5d8ebcd103d42dc70ad9cbb35 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Fri, 1 Feb 2008 09:30:43 +0000 Subject: 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 --- t/Nagios-Plugin-Range.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 't/Nagios-Plugin-Range.t') 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 @@ use strict; #use Test::More qw(no_plan); -use Test::More tests => 149; +use Test::More tests => 151; BEGIN { use_ok('Nagios::Plugin::Range'); @@ -157,8 +157,13 @@ $expected = { -95.999 => 1, -1 => 1, 0 => 1, - 123456789012344.91 => 1, + # The fractional values needs to be quoted, otherwise the hash rounds it up to ..345 + # and there is one less test run. + # I think some newer versions of perl use a higher precision value for the hash key. + # This doesn't appear to affect the actual plugin though + "123456789012344.91" => 1, 123456789012345 => 0, + "123456789012345.61" => 0, 123456789012346 => 0, }; test_expected( $r, $expected ); -- cgit v1.2.3-74-g34f1