This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Benchmark.t: add more diag output
[perl5.git] / lib / sort.t
index 62c5529..b44269a 100644 (file)
@@ -26,7 +26,7 @@ use strict;
 use warnings;
 
 use Test::More tests => @TestSizes * 2 # sort() tests
-                       * 4             # number of pragmas to test
+                       * 6             # number of pragmas to test
                        + 1             # extra test for qsort instability
                        + 3             # tests for sort::current
                        + 3;            # tests for "defaults" and "no sort"
@@ -125,8 +125,6 @@ sub main {
        $status = checkequal(\@sorted, $unsorted);
        is($status, '', "contents ok for size $ts");
     }
-    # If the following test (#58) fails, see the comments in pp_sort.c
-    # for Perl_sortsv().
     if ($expect_unstable) {
        ok($unstable_num > 0, 'Instability ok');
     }
@@ -163,16 +161,19 @@ main(sub { sort {&{$_[0]}} @{$_[1]} }, 0);
     no sort qw(_qsort);
     my $sort_current; BEGIN { $sort_current = sort::current(); }
     is($sort_current, 'stable', 'sort::current after no _qsort');
+    main(sub { sort {&{$_[0]}} @{$_[1]} }, 0);
 }
 
 {
     use sort qw(defaults _qsort);
     my $sort_current; BEGIN { $sort_current = sort::current(); }
     is($sort_current, 'quicksort', 'sort::current after defaults _qsort');
+    # Not expected to be stable, so don't test for stability here
 }
 
 {
     use sort qw(defaults stable);
     my $sort_current; BEGIN { $sort_current = sort::current(); }
     is($sort_current, 'stable', 'sort::current after defaults stable');
+    main(sub { sort {&{$_[0]}} @{$_[1]} }, 0);
 }