aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/perl5/catches_strings_runme.pl
blob: 742b5bcabce26e081e49b710340e2f99527fb04e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use strict;
use warnings;
use Test::More tests => 4;
BEGIN { use_ok('catches_strings') }
require_ok('catches_strings');

eval {
  catches_strings::StringsThrower::charstring();
};
like($@, qr/\bcharstring message/, "Should have thrown an exception");

eval {
  catches_strings::StringsThrower::stdstring();
};
like($@, qr/\bstdstring message/, "Should have thrown an exception");