diff options
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"); |
