diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2007-02-07 17:35:38 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2007-02-07 17:35:38 +0000 |
commit | 9692fb72f6f428dbed4e107dd83fa906854babff (patch) | |
tree | 16245cc807c653b55354cbf52e1b8f08b4d355e7 /t | |
parent | bc88f3deebba11a2a41839972a049a3c98451e34 (diff) | |
download | monitoring-plugin-perl-9692fb72f6f428dbed4e107dd83fa906854babff.tar.gz |
Added max_state function
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1615 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 't')
-rw-r--r-- | t/Nagios-Plugin-Functions-03.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/Nagios-Plugin-Functions-03.t b/t/Nagios-Plugin-Functions-03.t new file mode 100644 index 0000000..3706e4c --- /dev/null +++ b/t/Nagios-Plugin-Functions-03.t | |||
@@ -0,0 +1,21 @@ | |||
1 | # max_state 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( OK, WARNING ); | ||
9 | |||
10 | is( $new_state, WARNING, "Moved up to WARNING" ); | ||
11 | is( max_state( $new_state, UNKNOWN ), WARNING, "Still at WARNING" ); | ||
12 | |||
13 | $new_state = max_state( $new_state, CRITICAL ); | ||
14 | is( $new_state, CRITICAL, "Now at CRITICAL" ); | ||
15 | is( max_state( OK, OK ), OK, "This is OK" ); | ||
16 | |||
17 | is( max_state( OK, UNKNOWN ), OK, "This is still OK, not UNKNOWN" ); | ||
18 | |||
19 | is( max_state( OK, OK, OK, OK, OK, WARNING ), WARNING, "Use WARNING in this list" ); | ||
20 | |||
21 | is( max_state(), UNKNOWN, "Return UNKNOWN if no parameters" ); | ||