From cce4fccf608b3e4accf7cbf2f11da23b3d627f15 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 22 Dec 2011 11:56:08 -0500 Subject: check_threshold to check multiple values at once --- t/Nagios-Plugin-04.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/Nagios-Plugin-04.t b/t/Nagios-Plugin-04.t index d88ad73..e5eb3ab 100644 --- a/t/Nagios-Plugin-04.t +++ b/t/Nagios-Plugin-04.t @@ -3,7 +3,7 @@ use strict; #use Test::More 'no_plan'; -use Test::More tests=>26; +use Test::More tests=>30; BEGIN { use_ok('Nagios::Plugin') }; use Nagios::Plugin::Functions; @@ -52,6 +52,12 @@ is $p->check_threshold(6), WARNING, "check_threshold WARNING"; is $p->check_threshold(11), CRITICAL, "check_threshold CRITICAL"; is $p->check_threshold(check=>11), CRITICAL, "check_threshold CRITICAL with hash param"; +# Check that arrays allowed +is $p->check_threshold([2,1]), OK, "check_threshold OK when called implicitly"; +is $p->check_threshold([6,2]), WARNING, "check_threshold WARNING"; +is $p->check_threshold([1,2,6,11]), CRITICAL, "check_threshold CRITICAL"; +is $p->check_threshold(check=>[1,2,6,11]), CRITICAL, "check_threshold CRITICAL with hash param"; + # thresholds set explicitly is $p->check_threshold( check => 2, -- cgit v1.2.3-74-g34f1