summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/Nagios-Plugin-Getopt-03.t3
-rw-r--r--t/npg03/expected/15_badsection_catch1
-rw-r--r--t/npg03/input/15_badsection_catch1
3 files changed, 4 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Getopt-03.t b/t/Nagios-Plugin-Getopt-03.t
index 11443c8..560b782 100644
--- a/t/Nagios-Plugin-Getopt-03.t
+++ b/t/Nagios-Plugin-Getopt-03.t
@@ -96,7 +96,8 @@ for my $infile (glob File::Spec->catfile($tdir, 'input', $glob)) {
96 eval { $ng->getopts }; 96 eval { $ng->getopts };
97 if ($@) { 97 if ($@) {
98 chomp $@; 98 chomp $@;
99 ok($infile =~ m/_dies?$/, "$infile ($@)"); 99 ok($infile =~ m/_(dies?|catch)$/, "$infile ($@)");
100 is($@, $EXPECTED{$infile}, $infile) if ($infile =~ m/_catch$/);
100 } 101 }
101 else { 102 else {
102 is($plugin . ' ' . $ng->_cmdline, $EXPECTED{$infile}, $infile); 103 is($plugin . ' ' . $ng->_cmdline, $EXPECTED{$infile}, $infile);
diff --git a/t/npg03/expected/15_badsection_catch b/t/npg03/expected/15_badsection_catch
new file mode 100644
index 0000000..7505c2b
--- /dev/null
+++ b/t/npg03/expected/15_badsection_catch
@@ -0,0 +1 @@
Invalid section 'bad_section' in config file 't/npg03/plugins.ini'
diff --git a/t/npg03/input/15_badsection_catch b/t/npg03/input/15_badsection_catch
new file mode 100644
index 0000000..bcc026a
--- /dev/null
+++ b/t/npg03/input/15_badsection_catch
@@ -0,0 +1 @@
check_no_section_default_file --extra-opts=bad_section