summaryrefslogtreecommitdiffstats
path: root/t/Nagios-Plugin-Getopt-01.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Nagios-Plugin-Getopt-01.t')
-rw-r--r--t/Nagios-Plugin-Getopt-01.t13
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
3use strict; 3use strict;
4 4
5use Test::More tests => 72; 5use Test::More tests => 76;
6BEGIN { use_ok('Nagios::Plugin::Getopt') }; 6BEGIN { use_ok('Nagios::Plugin::Getopt') };
7 7
8my %PARAM = ( 8my %PARAM = (
@@ -45,6 +45,17 @@ is($ng->warning, 3, 'warning set to 3');
45is($ng->critical, 10, 'critical set to 10'); 45is($ng->critical, 10, 'critical set to 10');
46is($ng->timeout, 12, 'timeout set to 12'); 46is($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;
52is ($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;
57is ($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;