summaryrefslogtreecommitdiffstats
path: root/t/Nagios-Plugin-Functions-01.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Nagios-Plugin-Functions-01.t')
-rw-r--r--t/Nagios-Plugin-Functions-01.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Functions-01.t b/t/Nagios-Plugin-Functions-01.t
index 70db221..5268255 100644
--- a/t/Nagios-Plugin-Functions-01.t
+++ b/t/Nagios-Plugin-Functions-01.t
@@ -1,6 +1,6 @@
1 1
2use strict; 2use strict;
3use Test::More tests => 112; 3use Test::More tests => 113;
4 4
5BEGIN { use_ok("Nagios::Plugin::Functions", ":all"); } 5BEGIN { use_ok("Nagios::Plugin::Functions", ":all"); }
6Nagios::Plugin::Functions::_fake_exit(1); 6Nagios::Plugin::Functions::_fake_exit(1);
@@ -154,3 +154,8 @@ for (@ok) {
154 $_->[1] . '.*' . $_->[2])); 154 $_->[1] . '.*' . $_->[2]));
155} 155}
156 156
157# Check that _use_die set to 1 will catch exceptions correctly
158Nagios::Plugin::Functions::_fake_exit(0);
159Nagios::Plugin::Functions::_use_die(1);
160eval { nagios_die("Using die") };
161is( $@, "NAGIOS-PLUGIN-FUNCTIONS-01 UNKNOWN - Using die\n", "Caught exception");