git-p4: fix typos
[git/gitster.git] / t / chainlint-cat.pl
blob388f6e1e410cc862b543cac6ef970576769d0738
1 #!/usr/bin/env perl
3 my $outdir = shift;
4 open(my $tests, '>', "$outdir/tests")
5 or die "unable to open $outdir/tests: $!";
6 open(my $expect, '>', "$outdir/expect")
7 or die "unable to open $outdir/expect: $!";
9 print $expect "# chainlint: $outdir/tests\n";
11 my $offset = 0;
12 for my $script (@ARGV) {
13 print $expect "# chainlint: $script\n";
15 open(my $expect_in, '<', "chainlint/$script.expect")
16 or die "unable to open chainlint/$script.expect: $!";
17 while (<$expect_in>) {
18 s/^\d+/$& + $offset/e;
19 print $expect $_;
22 open(my $test_in, '<', "chainlint/$script.test")
23 or die "unable to open chainlint/$script.test: $!";
24 while (<$test_in>) {
25 /^# LINT: / and next;
26 print $tests $_;
27 $offset++;