Name Date Size #Lines LOC

..--

bench/H--5923

FindExt.tH A D05-Feb-20172.5 KiB7951

args_assert.tH A D01-Mar-20211.5 KiB6842

authors.tH A D28-Jan-20251.7 KiB4725

bench.tH A D15-Feb-202325.7 KiB855610

bench_selftest.tH A D13-Feb-2019198 114

bincompat.tH A D14-May-20241.9 KiB5948

checkcase.tH A D05-Feb-20171.3 KiB4926

checkcfgvar.tH A D28-Jan-20251.4 KiB3711

cmp_version.tH A D13-Feb-20191 KiB3210

copyright.tH A D14-May-20242.4 KiB9852

corelist.tH A D14-May-2024541 2416

customized.datH A D28-Jan-20252 KiB2625

customized.tH A D14-May-20243.5 KiB153104

deprecation.tH A D28-Jan-20254.4 KiB146121

diag.tH A D28-Jan-202524.5 KiB738626

dual-life.tH A D28-Jan-20252.1 KiB8357

exec-bit.tH A D28-Jan-20251.9 KiB7245

extrefs.tH A D28-Jan-20253.4 KiB13586

filenames.tH A D24-Mar-20141.9 KiB8360

globvar.tH A D28-Jan-20252.5 KiB9066

header_parser.tH A D14-May-202417.4 KiB621366

known_pod_issues.datH A D28-Jan-20258.2 KiB427426

libperl.tH A D28-Jan-202516.6 KiB510326

maintainers.tH A D05-Feb-20171,016 4727

makerel.tH A D28-Jan-2025874

manifest.tH A D14-May-20243.6 KiB12375

perlfunc.tH A D05-Feb-20171.5 KiB4214

pod_rules.tH A D15-Feb-20231.2 KiB4518

podcheck.tH A D28-Jan-202585.7 KiB2,2661,355

re_context.tH A D03-Jul-20161.2 KiB4412

readme.tH A D15-Feb-20232.3 KiB8162

regen.tH A D28-Jan-20254.2 KiB149120

ss_dup.tH A D05-Feb-2017856 4129

test_bootstrap.tH A D01-Mar-20212.6 KiB8653

test_testlist.tH A D28-Jan-20252.8 KiB9585

update_authors.tH A D14-May-20247 KiB19187

utils.tH A D28-Jan-20253 KiB10054

readme.t

1#!./perl -w
2#
3# Check whether all files mentioned in Porting/README.pod exist in Porting and
4# vice versa.
5
6BEGIN {
7    @INC = '..' if -f '../TestInit.pm';
8}
9
10use TestInit qw(T); # T is chdir to the top level
11use strict;
12use warnings;
13require './t/test.pl';
14
15my @porting_files;
16open my $man, "MANIFEST" or die "Can't open MANIFEST: $!";
17while(<$man>) {
18    /^Porting\// and s/[\t\n].*//s, push @porting_files, $_;
19}
20close $man or die "Can't close MANIFEST: $!";
21# It seems that dying here is nicer than having several dozen failing tests
22# later.  But that assumes one will see the message from die.
23die "Can't get contents of Porting/ directory.\n" unless @porting_files > 1;
24
25open(my $fh, '<', 'Porting/README.pod') or die("Can't open Porting/README.pod: $!");
26
27my (@current_order, @sorted_order, %files_in_pod);
28while(<$fh>) {
29    next unless $_ =~ /^=head/;
30    my @matches = $_ =~ m/F<([^>]+)>/g;
31    for my $file (@matches) {
32        $files_in_pod{$file} = 1;
33        push @current_order, $file;
34    }
35}
36
37for my $file (@porting_files) {
38    $file =~ s!^Porting/!!;
39    next if $file =~ /^perl[0-9]+delta\.pod$/;
40    ok(exists($files_in_pod{$file}), "$file is mentioned in Porting/README.pod");
41    delete $files_in_pod{$file};
42}
43for my $file (keys %files_in_pod) {
44    fail("$file exists in Porting/");
45}
46
47# Check if the entries in the README are in some sort of order.
48eval {
49    require Unicode::Collate;
50    my $Collator = Unicode::Collate->new();
51    @sorted_order = $Collator->sort(@current_order);
52};
53
54if(@sorted_order) {
55    ok(eq_array(\@current_order, \@sorted_order), "Files are referenced in order") or
56        print_right_order();
57}
58else {
59    note('Unicode collation did not work.  Not checking order of entries.');
60}
61
62# Frankly this is a bit much for a porting test, but it exists now.
63sub print_right_order {
64    my $max = 0;
65    for(@current_order) {
66        my $l = length $_;
67        $max = $l if $l > $max;
68    }
69    $max = 36 if $max > 36;
70    note(sprintf " N   %-${max}s %-${max}s\n", "Correct", "Current");
71    for(0..$#current_order) {
72        my $wrong = $sorted_order[$_] eq $current_order[$_] ? '' : 'X';
73        my $line = sprintf "%2d %1s %-${max}s %-${max}s\n",
74            $_, $wrong, $sorted_order[$_], $current_order[$_];
75        $line =~ s{ ((?:  ){2,})}{" " . ". " x (length($1)/2)}e if $_&1;
76        note($line);
77    }
78}
79
80done_testing();
81