Fixed the example showing parameter type constraints
[p5sagit/Function-Parameters.git] / t / eating_strict_error.t
CommitLineData
5bf140a1 1#!perl
2
e2640c25 3use Test::More tests => 4;
5bf140a1 4
5use warnings FATAL => 'all';
6use strict;
7
8use Dir::Self;
9
6c34b444 10for my $thing (map [__DIR__ . "/eating_strict_error$_->[0].fail", @$_[1 .. $#$_]], ['', 6], ['_2', 9]) {
e2640c25 11 my ($file, $line) = @$thing;
6c34b444 12 $@ = undef;
e2640c25 13 my $done = do $file;
14 my $exc = $@;
15 my $err = $!;
5bf140a1 16
e2640c25 17 is $done, undef, "faulty code doesn't load";
18 my $msg = qq{Global symbol "\$records" requires explicit package name at $file line $line.\n};
19 like $exc, qr{^\Q$msg};
20 $exc or die "$file: $err";
21}