File: no-format.t

package info (click to toggle)
liblog-ger-perl 0.042-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 300 kB
  • sloc: perl: 1,419; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!perl

use strict;
use warnings;
use Test::More 0.98;

use Log::ger::Output ();

package My::P1;
use Log::ger::Heavy;
{
    local $Log::ger::Default_Hooks{create_formatter} = [];
    Log::ger->import;
}

sub x {
    log_warn({a=>1, b=>2});
}

package My::P2;
use Log::ger;

sub x {
    log_warn({a=>3, b=>4}, "");
}

package main;

subtest "basics" => sub {
    my $ary = [];
    Log::ger::Output->set('Array', array => $ary);
    My::P1::x();
    is_deeply($ary, [{a=>1, b=>2}]);

    splice @$ary;
    My::P2::x();
    ok(!ref($ary->[0])) or diag explain $ary;
    like($ary->[0], qr/^HASH/);
};

done_testing;