~cfuhrman/log-fine/LOG-FINE-HANDLE-EMAIL

« back to all changes in this revision

Viewing changes to t/06-handle-output.t

  • Committer: Christopher M. Fuhrman
  • Date: 2008-05-07 23:24:25 UTC
  • mfrom: (0.1.1)
  • Revision ID: git-v1:2190a18b9709b4f9a7c8bee8b377be9369c7a29c
Copy imported Log::BSDLog from LOG-BSDLOG vendor tag


Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!perl -T
 
2
 
 
3
#
 
4
# $Id: 06-handle-output.t 45 2008-05-07 22:06:40Z cfuhrman $
 
5
#
 
6
 
 
7
use Test::Simple tests => 6;
 
8
 
 
9
use Log::BSDLog;
 
10
use Log::BSDLog::Handle::Output;
 
11
 
 
12
{
 
13
 
 
14
    my $msg = "This output is expected as part of the test.  Please ignore.";
 
15
 
 
16
    # get a logger
 
17
    my $log = Log::BSDLog->getLogger("handleoutput0");
 
18
 
 
19
    ok(ref $log eq "Log::BSDLog::Logger");
 
20
 
 
21
    # add a handle.  Note we use the default formatter.
 
22
    my $handle = Log::BSDLog::Handle::Output->new({ use_stderr => 1, });
 
23
 
 
24
    # do some validation
 
25
    ok($handle->isa("Log::BSDLog::Handle"));
 
26
 
 
27
    # these should be set to their default values
 
28
    ok($handle->{mask} == Log::BSDLog::Handle->DEFAULT_LOGMASK);
 
29
    ok($handle->{level} == DEBG);
 
30
    ok($handle->{formatter}->isa("Log::BSDLog::Formatter::Basic"));
 
31
 
 
32
    # Output-specific attributes
 
33
    ok($handle->{use_stderr});
 
34
 
 
35
    # write a test message
 
36
    $handle->msgWrite(INFO, "\n\n$msg\n\n", 1);
 
37
}