diff options
author | Ton Voon <tonvoon@macbook.local> | 2009-03-03 10:36:02 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@macbook.local> | 2009-03-03 10:36:02 +0000 |
commit | b0ff1e4262fa7f09c9cdb91206b6d2a2a1aa06a7 (patch) | |
tree | 2637e1eb1fbb9d09b7f4c5c97affaad1411b19f7 /t/Nagios-Plugin-Threshold.t | |
parent | c4f93de55930896e83d3abb519190704332b4e8f (diff) | |
download | monitoring-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.t | 14 |
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 | ||
2 | use strict; | 2 | use strict; |
3 | use Test::More tests => 87; | 3 | use Test::More tests => 93; |
4 | BEGIN { | 4 | BEGIN { |
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 | ||
14 | Nagios::Plugin::Functions::_fake_exit(1); | 14 | Nagios::Plugin::Functions::_fake_exit(1); |
15 | 15 | ||
16 | my $t; | ||
17 | |||
18 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => undef, critical => undef); | ||
19 | ok( defined $t, "two undefs" ); | ||
20 | ok( ! $t->warning->is_set, "warning not set" ); | ||
21 | ok( ! $t->critical->is_set, "critical not set" ); | ||
22 | |||
23 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => "", critical => ""); | ||
24 | ok( defined $t, "two empty strings" ); | ||
25 | ok( ! $t->warning->is_set, "warning not set" ); | ||
26 | ok( ! $t->critical->is_set, "critical not set" ); | ||
27 | |||
16 | diag "threshold: critical if > 80" if $ENV{TEST_VERBOSE}; | 28 | diag "threshold: critical if > 80" if $ENV{TEST_VERBOSE}; |
17 | my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80"); | 29 | my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80"); |
18 | ok( defined $t, "Threshold ('', '80') set"); | 30 | ok( defined $t, "Threshold ('', '80') set"); |