X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsort.t;h=ca809b0ffae9e58991ed6a13b6b519172b18713c;hb=73e51c8a2e5bd997f8b13e4f86b01e266a2d73f5;hp=62c5529c21e894d4d53bfcf16207c887ca1c7bde;hpb=7b9ef14019d3c4d1aa14641dbd421c81c2cd18a4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/sort.t b/lib/sort.t index 62c5529..ca809b0 100644 --- a/lib/sort.t +++ b/lib/sort.t @@ -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" @@ -163,16 +163,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); }