summaryrefslogtreecommitdiffstats
path: root/t/Monitoring-Plugin-Functions-03.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Monitoring-Plugin-Functions-03.t')
-rw-r--r--t/Monitoring-Plugin-Functions-03.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/Monitoring-Plugin-Functions-03.t b/t/Monitoring-Plugin-Functions-03.t
new file mode 100644
index 0000000..9f0a62c
--- /dev/null
+++ b/t/Monitoring-Plugin-Functions-03.t
@@ -0,0 +1,21 @@
1# max_state tests
2
3use strict;
4use Test::More tests => 8;
5
6BEGIN { use_ok("Monitoring::Plugin::Functions", ":all") }
7
8my $new_state = max_state( OK, WARNING );
9
10is( $new_state, WARNING, "Moved up to WARNING" );
11is( max_state( $new_state, UNKNOWN ), WARNING, "Still at WARNING" );
12
13$new_state = max_state( $new_state, CRITICAL );
14is( $new_state, CRITICAL, "Now at CRITICAL" );
15is( max_state( OK, OK ), OK, "This is OK" );
16
17is( max_state( OK, UNKNOWN ), OK, "This is still OK, not UNKNOWN" );
18
19is( max_state( OK, OK, OK, OK, OK, WARNING ), WARNING, "Use WARNING in this list" );
20
21is( max_state(), UNKNOWN, "Return UNKNOWN if no parameters" );