diff options
author | John P. Linderman <jpl@research.att.com> | 2002-07-21 08:13:32 -0400 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-05 22:42:09 +0000 |
commit | 7a8ff2dd4a456a3d3ba44383dd89457f1618ec20 (patch) | |
tree | 700dca886fd780685b1bda6fd760f343c181383f /lib/sort.t | |
parent | cc5470e2b2d9deadc4c9495a355863bbf6999707 (diff) | |
download | perl-7a8ff2dd4a456a3d3ba44383dd89457f1618ec20.tar.gz |
Re: mention of "use sort" botched in perlfunc? + PATCH
From: "John P. Linderman" <jpl@research.att.com>
Message-id: <200207211613.MAA69505@raptor.research.att.com>
p4raw-id: //depot/perl@17685
Diffstat (limited to 'lib/sort.t')
-rw-r--r-- | lib/sort.t | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/sort.t b/lib/sort.t index 990376576b..8828083066 100644 --- a/lib/sort.t +++ b/lib/sort.t @@ -28,7 +28,8 @@ use warnings; use Test::More tests => @TestSizes * 2 # sort() tests * 4 # number of pragmas to test + 1 # extra test for qsort instability - + 3; # tests for sort::current + + 3 # tests for sort::current + + 3; # tests for "defaults" and "no sort" # Generate array of specified size for testing sort. # @@ -160,3 +161,23 @@ eval q{ main(0); }; die $@ if $@; + +# Tests added to check "defaults" subpragma, and "no sort" + +eval q{ + no sort qw(_qsort); + is(sort::current(), 'stable', 'sort::current after no _qsort'); +}; +die $@ if $@; + +eval q{ + use sort qw(defaults _qsort); + is(sort::current(), 'quicksort', 'sort::current after defaults _qsort'); +}; +die $@ if $@; + +eval q{ + use sort qw(defaults stable); + is(sort::current(), 'stable', 'sort::current after defaults stable'); +}; +die $@ if $@; |