File: exception.t

package info (click to toggle)
libtest2-harness-perl 1.000161-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,904 kB
  • sloc: perl: 17,026; makefile: 10; ansic: 6; sh: 4
file content (14 lines) | stat: -rw-r--r-- 224 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use Test2::V0;
# HARNESS-DURATION-SHORT

my $file = __FILE__;
my $line = __LINE__ + 1;
sub throw { die("xxx") };

is(
    dies { throw() },
    "xxx at $file line $line.\n",
    "Got exception as expected"
);

done_testing;