File: exception.t

package info (click to toggle)
libtest-most-perl 0.38-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 543; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use lib 'lib', 't/lib';
use Test::Most tests => 4;
use Test::Most::Exception 'throw_failure';

ok defined &throw_failure,
  '&throw_failure should be exported to our namespace';

throws_ok { throw_failure error => 'some message' }
'Test::Most::Exception',
  '... and it should throw an exception';

my $error = $@;
is $error->message, 'some message',
  '... and it should have the proper error message';
is $error->description, 'Test failed.  Stopping test.',
  '... and the proper description';