summaryrefslogtreecommitdiffstats
path: root/t/Nagios-Plugin-Threshold.t
diff options
context:
space:
mode:
authorTon Voon <tonvoon@macbook.local>2009-03-03 10:36:02 +0000
committerTon Voon <tonvoon@macbook.local>2009-03-03 10:36:02 +0000
commitb0ff1e4262fa7f09c9cdb91206b6d2a2a1aa06a7 (patch)
tree2637e1eb1fbb9d09b7f4c5c97affaad1411b19f7 /t/Nagios-Plugin-Threshold.t
parentc4f93de55930896e83d3abb519190704332b4e8f (diff)
downloadmonitoring-plugin-perl-b0ff1e4262fa7f09c9cdb91206b6d2a2a1aa06a7.tar.gz
Added parsing of labels with spaces (thanks to Kang)
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");