Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 50 lines (36 sloc) 1.109 kb
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 45 46 47 48 49 50
#!/usr/bin/perl

# Copyright 2004-2011, Paul Johnson (pjcj@cpan.org)

# This software is free. It is licensed under the same terms as Perl itself.

# The latest version of this software should be available from my homepage:
# http://www.pjcj.net

use strict;
use warnings;

use Devel::Cover::Test;

if ($] == 5.008007)
{
    eval "use Test::More skip_all => 'Crashes 5.8.7'";
    exit;
}

my $run_test = sub
{
    my $test = shift;

    $test->run_command($test->test_command);

    $test->{test_parameters} .= " -merge 1";

    $test->{test_file_parameters} = "5";
    $test->run_command($test->test_command);

    $test->{test_file_parameters} = "7";
    $test->run_command($test->test_command);

    $test->{test_file_parameters} = "0";
    $test->run_command($test->test_command);
};

my $test = Devel::Cover::Test->new
(
    "eval2",
    golden_test => "eval_use.t",
    run_test => $run_test,
    changes => [ 'if (/^Run: /) { $get_line->() for 1 .. 5; redo }' ],
    tests => sub { $_[0] - 24 }, # number of lines deleted above
);

$test->run_test;
no warnings;
$test # for create_gold
Something went wrong with that request. Please try again.