Debian Codegraph @

t/errors.t

raw
1 use Test::More 0.96;
2 use Test::Snapshot;
3
4 use strict;
5 use warnings;
6
7 $ENV{TEST_SNAPSHOT_UPDATE} = 0; # override to ensure known value
8
9 my $errdiag;
10
11 {
12 no strict 'refs';
13 no warnings 'redefine';
14 *{"Test::More::diag"} = sub {
15 $errdiag = shift;
16 }
17 }
18
19 my $xcpt = 'blergo mymse throbbozongo';
20 $@ = $xcpt;
21
22 is_deeply_snapshot('foo bar', 'error');
23
24 unlike $errdiag, qr/$xcpt/, "exception not passed to diag()";
25
26 done_testing;