File: confess.t

package info (click to toggle)
libcontextual-return-perl 0.004014-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 348 kB
  • sloc: perl: 1,453; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
use Contextual::Return;
use Carp;
use Test::More tests => 3;

sub f { Carp::confess("Forgive me..."); };
ok !defined eval { f() }            => 'eval fails';
my $exception = $@;
  like $exception, qr{line\s${\(__LINE__-3)}\.?\n.*line\s${\(__LINE__-2)}}xms
         => 'error message';
unlike $exception, qr{\*\* Incomplete caller override detected; \@DB::args were not set \*\*}
        => 'Complete override';