From f2aa8f510828ddfb165f84ecc13aaf29d7bdfb4d Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 31 Aug 2006 08:34:24 +0000 Subject: Support multiple -v options for verbosity level git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1472 f882894a-f735-0410-b71e-b25c423dba1c --- t/Nagios-Plugin-Getopt-01.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/Nagios-Plugin-Getopt-01.t b/t/Nagios-Plugin-Getopt-01.t index fad68e3..b708a5f 100644 --- a/t/Nagios-Plugin-Getopt-01.t +++ b/t/Nagios-Plugin-Getopt-01.t @@ -2,7 +2,7 @@ use strict; -use Test::More tests => 72; +use Test::More tests => 76; BEGIN { use_ok('Nagios::Plugin::Getopt') }; my %PARAM = ( @@ -45,6 +45,17 @@ is($ng->warning, 3, 'warning set to 3'); is($ng->critical, 10, 'critical set to 10'); is($ng->timeout, 12, 'timeout set to 12'); +# Check multiple verbose flags +@ARGV = qw(-w 3 --critical 10 -v -v -v); +$ng = setup; +$ng->getopts; +is ($ng->verbose, 3, "Verbose set to level 3"); + +@ARGV = qw(-w 3 --critical 10 --verbose --verbose --verbose); +$ng = setup; +$ng->getopts; +is ($ng->verbose, 3, "Verbose set to level 3 (longhand)"); + # Missing args @ARGV = qw(); $ng = setup; -- cgit v1.2.3-74-g34f1