You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sipwise-base/t/exports.t

37 lines
707 B

use Sipwise::Base;
use Test::More import => [qw(done_testing ok)];
eval 'use t::StrictVars';
ok $@, 'strict vars';
eval 'use t::StrictSubs';
ok $@, 'strict subs';
eval '$$foobar';
ok $@, 'strict refs';
eval { my $foo = 1 + undef };
ok $@, 'fatal warnings';
eval 'say("")';
ok !$@, 'say syntax is available';
eval 'state $foobar = 1';
ok !$@, 'state syntax is available';
eval { unlink '/nonexistent' };
ok $@, 'autodie is in effect';
eval q{
try {
die bless { fnord => 42 } => 'Foobar';
} catch (Foobar $e) {
$e->isa('Foobar') or die 'TryCatch failed';
}
};
ok !$@, 'TryCatch is available and works';
ok uc("\xe4") eq "\xc4", 'unicode_strings in effect';
done_testing;