summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorTon Voon <tonvoon@macbook.local>2009-01-05 22:24:44 (GMT)
committerTon Voon <tonvoon@macbook.local>2009-01-05 22:24:44 (GMT)
commit67a45638154221708da7f92451143475bdc229ac (patch)
tree65917e7a12893ca1df3ea446864169d6c6076747 /t
parent91047f17af0454e94fbd30615f4a6959a593f48e (diff)
downloadmonitoring-plugin-perl-67a45638154221708da7f92451143475bdc229ac.tar.gz
Check for valid numerical value before returning perfdata object
Diffstat (limited to 't')
-rw-r--r--t/Nagios-Plugin-Performance.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t
index e3fac07..8426828 100644
--- a/t/Nagios-Plugin-Performance.t
+++ b/t/Nagios-Plugin-Performance.t
@@ -16,7 +16,7 @@ my @test = (
16 }, 16 },
17); 17);
18 18
19plan tests => (8 * scalar @test) + 132; 19plan tests => (8 * scalar @test) + 135;
20 20
21use_ok('Nagios::Plugin::Performance'); 21use_ok('Nagios::Plugin::Performance');
22diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; 22diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE};
@@ -250,4 +250,10 @@ is( $p[0]->threshold->warning, 60, "warn okay");
250is( $p[0]->threshold->critical->is_set, 1, "Critical range has been set"); 250is( $p[0]->threshold->critical->is_set, 1, "Critical range has been set");
251is( $p[0]->threshold->critical, 120, "warn okay"); 251is( $p[0]->threshold->critical, 120, "warn okay");
252 252
253# Some values with funny commas
254@p = Nagios::Plugin::Performance->parse_perfstring("time=1800,600,300,0,3600 other=45.6");
255is( $p[0]->label, "other", "Ignored time=1800,600,300,0,3600, but allowed other=45.6");
256is( $p[0]->value, 45.6, "value okay");
257is( $p[0]->uom, "", "uom okay");
258
253# add_perfdata tests in t/Nagios-Plugin-01.t 259# add_perfdata tests in t/Nagios-Plugin-01.t