8 use Test::More tests => 4;
10 use App::Rgit::Config;
11 use App::Rgit::Utils qw/:levels/;
13 local $SIG{__WARN__} = sub { diag 'warning:', @_ };
14 local $SIG{__DIE__} = sub { diag 'exception:', @_ };
22 my @levels = sort { $levels{$b} <=> $levels{$a} } keys %levels;
25 open $olderr, '>&', \*STDERR or die "Can't dup STDERR: $!";
27 for my $l (0 .. $#levels) {
28 my $arc = App::Rgit::Config->new(
31 debug => $levels{$levels[$l]},
35 open STDERR, '>', \$buf or die "open(STDERR, '>', \\\$buf): $!";
36 $arc->$_($_) for qw/info warn err crit/;
37 is $buf, join('', @levels[$l .. $#levels]), "level $l ok";
41 open STDERR, '>&', $olderr or die "Can't dup \$olderr: $!";