summaryrefslogtreecommitdiffstats
path: root/t/Nagios-Plugin-Threshold.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Nagios-Plugin-Threshold.t')
-rw-r--r--t/Nagios-Plugin-Threshold.t14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Threshold.t b/t/Nagios-Plugin-Threshold.t
index d3711bb..78d2189 100644
--- a/t/Nagios-Plugin-Threshold.t
+++ b/t/Nagios-Plugin-Threshold.t
@@ -1,6 +1,6 @@
1 1
2use strict; 2use strict;
3use Test::More tests => 87; 3use Test::More tests => 93;
4BEGIN { 4BEGIN {
5 use_ok('Nagios::Plugin::Threshold'); 5 use_ok('Nagios::Plugin::Threshold');
6 use_ok('Nagios::Plugin::Functions', ':all' ); 6 use_ok('Nagios::Plugin::Functions', ':all' );
@@ -13,6 +13,18 @@ diag "\nusing Nagios::Plugin::Threshold revision ". $Nagios::Plugin::Threshold::
13 13
14Nagios::Plugin::Functions::_fake_exit(1); 14Nagios::Plugin::Functions::_fake_exit(1);
15 15
16my $t;
17
18$t = Nagios::Plugin::Threshold->set_thresholds(warning => undef, critical => undef);
19ok( defined $t, "two undefs" );
20ok( ! $t->warning->is_set, "warning not set" );
21ok( ! $t->critical->is_set, "critical not set" );
22
23$t = Nagios::Plugin::Threshold->set_thresholds(warning => "", critical => "");
24ok( defined $t, "two empty strings" );
25ok( ! $t->warning->is_set, "warning not set" );
26ok( ! $t->critical->is_set, "critical not set" );
27
16diag "threshold: critical if > 80" if $ENV{TEST_VERBOSE}; 28diag "threshold: critical if > 80" if $ENV{TEST_VERBOSE};
17my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80"); 29my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80");
18ok( defined $t, "Threshold ('', '80') set"); 30ok( defined $t, "Threshold ('', '80') set");