File: 12_inherit.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 (28 lines) | stat: -rw-r--r-- 622 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
25
26
27
28
use strict;
use Test::More tests => 6;

use Log::Dispatch::Config;

package Foo::Logger;
use base qw(Log::Dispatch::Config);

package Bar::Logger;
use base qw(Log::Dispatch::Config);

package main;
Foo::Logger->configure('t/log.cfg');
Bar::Logger->configure('t/log.ini');

my $foo = Foo::Logger->instance;
my $bar = Bar::Logger->instance;
my $bar2 = Bar::Logger->instance;

isa_ok $foo, 'Foo::Logger';
isa_ok $foo, 'Log::Dispatch::Config';
isa_ok $bar, 'Bar::Logger';
isa_ok $bar, 'Log::Dispatch::Config';

isnt "$foo", "$bar", 'not same one';
is "$bar", "$bar2", 'same one';

END { unlink 't/log.out' if -e 't/log.out' }