From b0ff1e4262fa7f09c9cdb91206b6d2a2a1aa06a7 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Tue, 3 Mar 2009 10:36:02 +0000 Subject: Added parsing of labels with spaces (thanks to Kang) --- t/Nagios-Plugin-Threshold.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 't/Nagios-Plugin-Threshold.t') 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 @@ use strict; -use Test::More tests => 87; +use Test::More tests => 93; BEGIN { use_ok('Nagios::Plugin::Threshold'); use_ok('Nagios::Plugin::Functions', ':all' ); @@ -13,6 +13,18 @@ diag "\nusing Nagios::Plugin::Threshold revision ". $Nagios::Plugin::Threshold:: Nagios::Plugin::Functions::_fake_exit(1); +my $t; + +$t = Nagios::Plugin::Threshold->set_thresholds(warning => undef, critical => undef); +ok( defined $t, "two undefs" ); +ok( ! $t->warning->is_set, "warning not set" ); +ok( ! $t->critical->is_set, "critical not set" ); + +$t = Nagios::Plugin::Threshold->set_thresholds(warning => "", critical => ""); +ok( defined $t, "two empty strings" ); +ok( ! $t->warning->is_set, "warning not set" ); +ok( ! $t->critical->is_set, "critical not set" ); + diag "threshold: critical if > 80" if $ENV{TEST_VERBOSE}; my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80"); ok( defined $t, "Threshold ('', '80') set"); -- cgit v1.2.3-74-g34f1