[Nagiosplug-checkins] SF.net SVN: nagiosplug: [1921] Nagios-Plugin/trunk

tonvoon at users.sourceforge.net tonvoon at users.sourceforge.net
Fri Feb 1 10:30:43 CET 2008


Revision: 1921
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1921&view=rev
Author:   tonvoon
Date:     2008-02-01 01:30:43 -0800 (Fri, 01 Feb 2008)

Log Message:
-----------
Fixed a test where a fractional number was stripped out
of the hash key, causing test failures

Modified Paths:
--------------
    Nagios-Plugin/trunk/Changes
    Nagios-Plugin/trunk/t/Nagios-Plugin-Range.t

Modified: Nagios-Plugin/trunk/Changes
===================================================================
--- Nagios-Plugin/trunk/Changes	2008-01-31 11:52:45 UTC (rev 1920)
+++ Nagios-Plugin/trunk/Changes	2008-02-01 09:30:43 UTC (rev 1921)
@@ -1,5 +1,8 @@
 Revision history for Perl module Nagios::Plugin.
 
+0.24  1st February 2008
+  - Fixed a test failure which highlighted a precision rounding within hashes
+
 0.23  18th December 2007
   - Use $^X for perl in check_stuff.t test, due to lots of failing in CPAN Testers
 

Modified: Nagios-Plugin/trunk/t/Nagios-Plugin-Range.t
===================================================================
--- Nagios-Plugin/trunk/t/Nagios-Plugin-Range.t	2008-01-31 11:52:45 UTC (rev 1920)
+++ Nagios-Plugin/trunk/t/Nagios-Plugin-Range.t	2008-02-01 09:30:43 UTC (rev 1921)
@@ -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 @@
     -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 );


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list