1 #!/usr/local/bin/perl -sw
9 my @sort_styles = qw( plain orcish ST GRT ) ;
15 name => 'hashes of strings',
17 { a => rand_token( 8, 20 ) }
20 gold => sub { $a->{a} cmp $b->{a} },
21 args => [ qw( string $_->{a} ) ],
25 name => 'hashes of numbers',
27 { a => rand_number( 1, 20 ) }
30 gold => sub { $a->{a} <=> $b->{a} },
31 args => [ qw( number $_->{a} ) ],
35 name => 'hashes of multiple strings',
37 { a => rand_token( 8, 20 ),
38 b => rand_token( 8, 20 ), }
41 gold => sub { $a->{a} cmp $b->{a} ||
42 $a->{b} cmp $b->{b} },
43 args => [ qw( string $_->{a} string $_->{b} ) ],
47 name => 'hashes of multiple numbers',
49 { a => rand_number( 1, 20 ),
50 b => rand_number( 1, 20 ) }
53 gold => sub { $a->{a} <=> $b->{a} ||
54 $a->{b} <=> $b->{b} },
55 args => [ qw( number $_->{a} number $_->{b} ) ],
59 common_driver( $sort_tests, \@sort_styles ) ;