summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/Nagios-Plugin-Performance.t11
1 files changed, 10 insertions, 1 deletions
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 @@
1 1
2use strict; 2use strict;
3use Test::More tests => 84; 3use Test::More tests => 91;
4BEGIN { use_ok('Nagios::Plugin::Performance') }; 4BEGIN { use_ok('Nagios::Plugin::Performance') };
5 5
6diag "\nusing Nagios::Plugin::Performance revision ". $Nagios::Plugin::Performance::VERSION . "\n" if $ENV{TEST_VERBOSE}; 6diag "\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");
133cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay"); 133cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay");
134cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay"); 134cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay");
135 135
136@p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95");
137cmp_ok( $p[0]->label, "eq", "pct_used", "label okay");
138cmp_ok( $p[0]->value, "eq", "73.7", "value okay");
139cmp_ok( $p[0]->uom, "eq", "%", "uom okay");
140 ok( defined eval { $p[0]->threshold->warning->is_set }, "Warning range has been set");
141 ok( defined eval { $p[0]->threshold->critical->is_set }, "Critical range has been set");
142cmp_ok( $p[0]->threshold->warning, 'eq', "90", "warn okay");
143cmp_ok( $p[0]->threshold->critical, 'eq', "95", "crit okay");
144
136# add_perfdata tests in t/Nagios-Plugin-01.t 145# add_perfdata tests in t/Nagios-Plugin-01.t