Get the status actually active at buddy signon instead of hardcoding AVAILABLE.
[thrasher.git] / perl / tests / debug.pl
blobf5881d2f8c0d16e34c034b7cb56dc591dd65b631
1 #!/usr/bin/perl
3 use Test::More tests => 4;
5 BEGIN {
6 use_ok('Thrasher::Log', qw(logger debug dies));
7 $Thrasher::Log::SILENT = 1;
8 };
10 my $rand_num = int rand 100000;
11 my $test_msg = "test message $rand_num";
13 my ($fn, $line, $msg) = logger($test_msg);
15 is ("$fn:$line $msg",
16 "$0:$line $test_msg",
17 "Valid message call");
19 is (debug("$test_msg"),
21 "Silent debug call");
23 $Thrasher::Log::DEBUG = 1;
25 $test_msg .= int rand 1000000;
26 ($fn, $line, $msg) = logger($test_msg);
28 is ("$fn: $msg",
29 "$0: $test_msg",
30 "Loud debug call");
32 # TODO: flip dies subroutine to use Error and test on try/throw