1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#!perl
# Test the basic Modern::Perl functionality works.
use Test::More 'no_plan';
use Test::Warn;
use perl5i::latest;
no if $] >= 5.018000, warnings => 'experimental::smartmatch';
# strict?
{
ok !eval '$foo = 42', "strict is on";
like $@, qr/^Global symbol "\$foo" requires explicit package name/;
}
# warnings?
{
my $foo;
warning_like {
$foo + 4;
}
qr/^Use of uninitialized value/;
}
# 5.10 features?
{
my $thing = 42;
given($thing) {
when(42) {
pass("given/when enabled");
}
default {
fail("shouldn't reach here");
}
}
}
# C3?
{
is mro::get_mro(__PACKAGE__), "c3", "C3 on";
}
|