diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-19 03:58:09 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-19 03:58:09 +0000 |
commit | 53d04242544a69e5fe226211bfb0186414941a9f (patch) | |
tree | c5334576ed7564c3db145dd9a7ab03e345da137a /t/Nagios-Plugin-Functions-04.t | |
parent | c47e1a9c28db2890f724ee57e59f3a3c30d7740c (diff) | |
download | monitoring-plugin-perl-53d04242544a69e5fe226211bfb0186414941a9f.tar.gz |
Add max_state_* interface warper to Nagios::Plugin object
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@2082 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 't/Nagios-Plugin-Functions-04.t')
-rw-r--r-- | t/Nagios-Plugin-Functions-04.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/Nagios-Plugin-Functions-04.t b/t/Nagios-Plugin-Functions-04.t new file mode 100644 index 0000000..d3ff05c --- /dev/null +++ b/t/Nagios-Plugin-Functions-04.t | |||
@@ -0,0 +1,21 @@ | |||
1 | # max_state_alt tests | ||
2 | |||
3 | use strict; | ||
4 | use Test::More tests => 8; | ||
5 | |||
6 | BEGIN { use_ok("Nagios::Plugin::Functions", ":all") } | ||
7 | |||
8 | my $new_state = max_state_alt( OK, WARNING ); | ||
9 | |||
10 | is( $new_state, WARNING, "Moved up to WARNING" ); | ||
11 | is( max_state_alt( $new_state, UNKNOWN ), WARNING, "Still at WARNING" ); | ||
12 | |||
13 | $new_state = max_state_alt( $new_state, CRITICAL ); | ||
14 | is( $new_state, CRITICAL, "Now at CRITICAL" ); | ||
15 | is( max_state_alt( OK, OK ), OK, "This is OK" ); | ||
16 | |||
17 | is( max_state_alt( OK, UNKNOWN ), UNKNOWN, "This is UNKNOWN" ); | ||
18 | |||
19 | is( max_state_alt( OK, OK, OK, OK, OK, WARNING ), WARNING, "Use WARNING in this list" ); | ||
20 | |||
21 | is( max_state_alt(), UNKNOWN, "Return UNKNOWN if no parameters" ); | ||