1#!/usr/bin/perl 2 3use strict; 4use warnings; 5no warnings 'syntax'; 6 7use 5.010; 8 9use lib "."; 10 11use Test::Tester; 12use Test::Regexp; 13use t::Common; 14 15my $match_res; 16 17foreach my $reason (undef, "", 0, "Bla bla bla") { 18 foreach my $name ("", "Baz", "Qux Quux") { 19 foreach my $match (0, 1) { 20 my $pattern = $match ? qr {Foo} : qr {Bar}; 21 my ($premature, @results) = run_tests sub { 22#line 999 160_show_line 23 $match_res = match subject => "Foo", 24 pattern => $pattern, 25 match => $match, 26 reason => $reason, 27 test => $reason, 28 name => $name, 29 show_line => 1, 30 }; 31 32 check results => \@results, 33 premature => $premature, 34 expected => $match ? 'PPPP' : 'P', 35 match => $match, 36 match_res => $match_res, 37 pattern => $pattern, 38 subject => "Foo", 39 comment => $name, 40 keep => 0, 41 line => [999 => '160_show_line'], 42 $match ? (test => $reason) 43 : (reason => $reason), 44 ; 45 } 46 } 47} 48 49 50__END__ 51