File: gen_pp_test.pl

package info (click to toggle)
libstring-diff-perl 0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 296 kB
  • sloc: perl: 333; sh: 20; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;
use Path::Class;

my $t = Path::Class::Dir->new('t');
for my $file ($t->children) {
    next if $file->is_dir;
    next if $file->basename =~ /^.+\-pp\.t$/;
    next if $file->basename =~ /^9.+\.t$/;
    next unless $file->basename =~ /^\d.+\.t$/;
    my $new_name = $file->basename;
    $new_name =~ s/\.t$/-pp.t/;

    my $data = $file->slurp;
    my $fh = $t->file($new_name)->openw;
    print $fh "BEGIN{ \$ENV{STRING_DIFF_PP} = 1; }\n$data";
    close $fh;
}