File: errors.t

package info (click to toggle)
libtest-snapshot-perl 0.06-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 116 kB
  • sloc: perl: 234; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 441 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
use Test::More 0.96;
use Test::Snapshot;

use strict;
use warnings;

$ENV{TEST_SNAPSHOT_UPDATE} = 0; # override to ensure known value

my $errdiag;

{
    no strict 'refs';
    no warnings 'redefine';
    *{"Test::More::diag"} = sub {
        $errdiag = shift;
    }
}

my $xcpt = 'blergo mymse throbbozongo';
$@ = $xcpt;

is_deeply_snapshot('foo bar', 'error');

unlike $errdiag, qr/$xcpt/, "exception not passed to diag()";

done_testing;