File: 20exceptions.t

package info (click to toggle)
liblog-report-optional-perl 1.01-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 132 kB
  • ctags: 53
  • sloc: perl: 448; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env perl
# Test the fake exceptions

use Test::More tests => 3;

use Log::Report::Minimal;

eval "error 'help!'";
is($@, "error: help!\n", $@);

{   my $w;
    eval { local $SIG{__WARN__} = sub {$w = join ';', @_};
           warning 'auch!' };
    is($@, '', $@);  # no die
    is($w, "warning: auch!\n");
}