interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / chainlint-cat.pl

29 lines · 709 bytes Raw Blame History
1#!/usr/bin/env perl
2
3my $outdir = shift;
4open(my $tests, '>', "$outdir/tests")
5 or die "unable to open $outdir/tests: $!";
6open(my $expect, '>', "$outdir/expect")
7 or die "unable to open $outdir/expect: $!";
8
9print $expect "# chainlint: $outdir/tests\n";
10
11my $offset = 0;
12for my $script (@ARGV) {
13 print $expect "# chainlint: $script\n";
14
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 $_;
20 }
21
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++;
28 }
29}