This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/harness: Remove useless sort
authorKarl Williamson <khw@cpan.org>
Wed, 22 Mar 2017 03:41:34 +0000 (21:41 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 1 Jun 2017 13:05:15 +0000 (07:05 -0600)
Instead move its effect to the sort that overrides the first one.  This
is because the tests are executed in the order of the rules to
TAP::Harness, not in the order of the test list.

t/harness

index b46582d..0ff4d85 100644 (file)
--- a/t/harness
+++ b/t/harness
@@ -145,7 +145,7 @@ if (@ARGV) {
        push @seq, $next;
 
        my @last;
        push @seq, $next;
 
        my @last;
-       push @last,  sort { lc $a cmp lc $b }
+       push @last,
            _tests_from_manifest($Config{extensions}, $Config{known_extensions});
        my %times;
        if ($state) {
            _tests_from_manifest($Config{extensions}, $Config{known_extensions});
        my %times;
        if ($state) {
@@ -174,7 +174,7 @@ if (@ARGV) {
        # sequentially.
        push @seq, { par => [ map { s!/$!/*!; { seq => $_ } } sort {
            # Directories, ordered by total time descending then name ascending
        # sequentially.
        push @seq, { par => [ map { s!/$!/*!; { seq => $_ } } sort {
            # Directories, ordered by total time descending then name ascending
-           $total_time{$b} <=> $total_time{$a} || $a cmp $b
+           $total_time{$b} <=> $total_time{$a} || lc $a cmp lc $b
        } keys %dir ] };
 
        $rules = { seq => \@seq };
        } keys %dir ] };
 
        $rules = { seq => \@seq };