File: 08_datetime.t

package info (click to toggle)
liblog-dispatch-config-perl 1.04-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 224 kB
  • sloc: perl: 233; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 505 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use Test::More tests => 3;

use IO::Scalar;

use Log::Dispatch::Config;
Log::Dispatch::Config->configure('t/date.cfg');

my $disp = Log::Dispatch::Config->instance;
isa_ok $disp->{outputs}->{screen}, 'Log::Dispatch::Screen';

{
    my($mday, $mon, $year) = (localtime(time))[3..5];
    my $today = sprintf '%04s%02d%02d', $year + 1900, $mon + 1, $mday;

    tie *STDERR, 'IO::Scalar', \my $err;
    $disp->debug('debug');

    like $err, qr/$today/, $err;
    like $err, qr/debug/, $err;
}