From 3ec5d3b8b2426a9acce2faa23a58e615af62930f Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Tue, 4 Sep 2007 13:17:01 +0000 Subject: Fixed CPAN test failures due to bad MANIFEST. Fixed version numbering Fixed a performance parsing problem where uom=% wasn't being recognised git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1775 f882894a-f735-0410-b71e-b25c423dba1c --- t/Nagios-Plugin-Performance.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t index c4d518c..0574ea0 100644 --- a/t/Nagios-Plugin-Performance.t +++ b/t/Nagios-Plugin-Performance.t @@ -1,6 +1,6 @@ use strict; -use Test::More tests => 84; +use Test::More tests => 91; BEGIN { use_ok('Nagios::Plugin::Performance') }; diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; @@ -133,4 +133,13 @@ cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay"); cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay"); +@p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95"); +cmp_ok( $p[0]->label, "eq", "pct_used", "label okay"); +cmp_ok( $p[0]->value, "eq", "73.7", "value okay"); +cmp_ok( $p[0]->uom, "eq", "%", "uom okay"); + ok( defined eval { $p[0]->threshold->warning->is_set }, "Warning range has been set"); + ok( defined eval { $p[0]->threshold->critical->is_set }, "Critical range has been set"); +cmp_ok( $p[0]->threshold->warning, 'eq', "90", "warn okay"); +cmp_ok( $p[0]->threshold->critical, 'eq', "95", "crit okay"); + # add_perfdata tests in t/Nagios-Plugin-01.t -- cgit v1.2.3-74-g34f1