multitest more perl versions; also list successes
[p5sagit/Function-Parameters.git] / t / strict.t
CommitLineData
87b6b3ed 1use warnings;
2use strict;
3
ae6e00b5 4use Test::More tests => 10;
87b6b3ed 5
6use Dir::Self;
7
8for my $fail (
9 map [__DIR__ . "/strict_$_->[0].fail", @$_[1 .. $#$_]],
10 ['1', qr/expect.*\).*after.*"\@y".*"\$z"/],
11 ['2', qr/expect.*\).*after.*"\@x".*"\$y"/],
12 ['3', qr/expect.*\).*after.*"%y".*"\$z"/],
13 ['4', qr/expect.*\).*after.*"\@y".*"\@z"/],
ae6e00b5 14 ['5', qr/Invalid.*rarity/],
87b6b3ed 15) {
16 my ($file, $pat) = @$fail;
6c34b444 17 $@ = undef;
87b6b3ed 18 my $done = do $file;
19 my $exc = $@;
20 my $err = $!;
21
22 is $done, undef, "faulty code doesn't load";
23 $exc or die "$file: $err" if $err;
24 like $exc, $pat;
25}