diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-08-31 08:34:24 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-08-31 08:34:24 +0000 |
commit | f2aa8f510828ddfb165f84ecc13aaf29d7bdfb4d (patch) | |
tree | b5445def675470d2eae0d61ed159b3b59b3dae11 /t/Nagios-Plugin-Getopt-01.t | |
parent | 2b422c372ee109303984ca8bac6f5ea3d5976dc0 (diff) | |
download | monitoring-plugin-perl-f2aa8f510828ddfb165f84ecc13aaf29d7bdfb4d.tar.gz |
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
Diffstat (limited to 't/Nagios-Plugin-Getopt-01.t')
-rw-r--r-- | t/Nagios-Plugin-Getopt-01.t | 13 |
1 files changed, 12 insertions, 1 deletions
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 @@ | |||
2 | 2 | ||
3 | use strict; | 3 | use strict; |
4 | 4 | ||
5 | use Test::More tests => 72; | 5 | use Test::More tests => 76; |
6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; | 6 | BEGIN { use_ok('Nagios::Plugin::Getopt') }; |
7 | 7 | ||
8 | my %PARAM = ( | 8 | my %PARAM = ( |
@@ -45,6 +45,17 @@ is($ng->warning, 3, 'warning set to 3'); | |||
45 | is($ng->critical, 10, 'critical set to 10'); | 45 | is($ng->critical, 10, 'critical set to 10'); |
46 | is($ng->timeout, 12, 'timeout set to 12'); | 46 | is($ng->timeout, 12, 'timeout set to 12'); |
47 | 47 | ||
48 | # Check multiple verbose flags | ||
49 | @ARGV = qw(-w 3 --critical 10 -v -v -v); | ||
50 | $ng = setup; | ||
51 | $ng->getopts; | ||
52 | is ($ng->verbose, 3, "Verbose set to level 3"); | ||
53 | |||
54 | @ARGV = qw(-w 3 --critical 10 --verbose --verbose --verbose); | ||
55 | $ng = setup; | ||
56 | $ng->getopts; | ||
57 | is ($ng->verbose, 3, "Verbose set to level 3 (longhand)"); | ||
58 | |||
48 | # Missing args | 59 | # Missing args |
49 | @ARGV = qw(); | 60 | @ARGV = qw(); |
50 | $ng = setup; | 61 | $ng = setup; |