diff options
author | Larry Wall <lwall@netlabs.com> | 1991-11-05 09:55:53 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1991-11-05 09:55:53 +0000 |
commit | 55204971972392ce5a252fbbd6d78b1c48ed70e3 (patch) | |
tree | a0fc0fa7a40dae3b455667572b9aac94b020c246 /t | |
parent | de3bb51191e884300caf98892ecfcc0ca3ebc09c (diff) | |
download | perl-55204971972392ce5a252fbbd6d78b1c48ed70e3.tar.gz |
perl 4.0 patch 18: patch #11, continued
See patch #11.
Diffstat (limited to 't')
-rw-r--r-- | t/op/sort.t | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/t/op/sort.t b/t/op/sort.t index b1b2202d2b..73a394421c 100644 --- a/t/op/sort.t +++ b/t/op/sort.t @@ -1,8 +1,8 @@ #!./perl -# $Header: sort.t,v 4.0 91/03/20 01:54:38 lwall Locked $ +# $RCSfile: sort.t,v $$Revision: 4.0.1.1 $$Date: 91/11/05 18:43:47 $ -print "1..8\n"; +print "1..9\n"; sub reverse { $a lt $b ? 1 : $a gt $b ? -1 : 0; } @@ -37,3 +37,7 @@ print ("@b" eq "3 2 1" ? "ok 7\n" : "not ok 7 (@b)\n"); @a = (1,2,3,4); @b = reverse @a; print ("@b" eq "4 3 2 1" ? "ok 8\n" : "not ok 8 (@b)\n"); + +@a = (10,2,3,4); +@b = sort {$a <=> $b;} @a; +print ("@b" eq "2 3 4 10" ? "ok 9\n" : "not ok 9 (@b)\n"); |