forked from pjcj/Devel--Cover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
md5.t
47 lines (32 loc) · 997 Bytes
/
md5.t
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
#!/usr/bin/perl
# Copyright 2002-2006, 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 File::Copy;
use Devel::Cover::Inc 0.56;
use Devel::Cover::Test 0.56;
my $base = $Devel::Cover::Inc::Base;
my $t = "md5";
my $ft = "$base/tests/$t";
my $fg = "$base/tests/trivial";
my $run_test = sub
{
my $test = shift;
copy($fg, $ft) or die "Cannot copy $fg to $ft: $!";
open T, ">>$ft" or die "Cannot open $ft: $!";
print T "# blah blah\n";
close T or die "Cannot close $ft: $!";
$test->run_command($test->test_command);
copy($fg, $ft) or die "Cannot copy $fg to $ft: $!";
$test->{test_parameters} .= " -merge 1";
$test->run_command($test->test_command);
};
my $test = Devel::Cover::Test->new
(
$t,
run_test => $run_test,
end => sub { unlink $ft },
);