From 91047f17af0454e94fbd30615f4a6959a593f48e Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Sat, 13 Dec 2008 14:17:49 +0000 Subject: One other test, from check_ntp_time diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t index d167979..e3fac07 100644 --- a/t/Nagios-Plugin-Performance.t +++ b/t/Nagios-Plugin-Performance.t @@ -16,7 +16,7 @@ my @test = ( }, ); -plan tests => (8 * scalar @test) + 125; +plan tests => (8 * scalar @test) + 132; use_ok('Nagios::Plugin::Performance'); diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; @@ -239,4 +239,15 @@ is( $p[1]->threshold->warning, "20", "warn okay"); is( $p[1]->threshold->critical->is_set, 1, "Critical range has been set"); is( $p[1]->threshold->critical, "60", "warn okay"); + +# Another set of comma separated stuff +@p = Nagios::Plugin::Performance->parse_perfstring("offset=-0,023545s;60,000000;120,000000;"); +is( $p[0]->label, "offset", "label okay for numeric with commas instead of periods"); +is( $p[0]->value, -0.023545, "value okay"); +is( $p[0]->uom, "s", "uom okay"); +is( $p[0]->threshold->warning->is_set, 1, "Warning range has been set"); +is( $p[0]->threshold->warning, 60, "warn okay"); +is( $p[0]->threshold->critical->is_set, 1, "Critical range has been set"); +is( $p[0]->threshold->critical, 120, "warn okay"); + # add_perfdata tests in t/Nagios-Plugin-01.t -- cgit v0.10-9-g596f