1 #!/usr/local/bin/perl -sw
11 #my @sort_styles = qw( plain ) ;
12 my @sort_styles = qw( plain orcish ST GRT ) ;
14 #my @string_keys = map rand_alpha( 4, 8 ), 1 .. 5 ;
15 my @string_keys = map rand_alpha( 4, 8 ), 1 .. 100 ;
17 #print "STR @string_keys NUM @number_keys\n" ;
23 gen => sub { rand_choice( @string_keys ) },
24 gold => sub { ($a =~ /(\w+)/)[0] cmp ($b =~ /(\w+)/)[0] },
26 string => [ qw( string /(\w+)/ ) ],
27 qr => [ string => qr/(\w+)/ ],
28 code => [ string => sub { /(\w+)/ } ],
35 [ rand_token( 8, 20 ) ]
38 gold => sub { $a->[0] cmp $b->[0] },
40 string => [ qw( string $_->[0] ) ],
41 code => [ string => sub { $_->[0] } ],
48 { a => rand_token( 8, 20 ) }
51 gold => sub { $a->{a} cmp $b->{a} },
53 string => [ qw( string $_->{a} ) ],
54 code => [ string => sub { $_->{a} } ],
59 common_driver( $sort_tests, \@sort_styles ) ;