/[jsFind]/trunk/t/06base62.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/06base62.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (hide annotations)
Sun Sep 5 18:00:46 2004 UTC (19 years, 8 months ago) by dpavlin
File MIME type: application/x-troff
File size: 624 byte(s)
added forgot base62 test

1 dpavlin 16 #!/usr/bin/perl
2    
3     use strict;
4     use warnings;
5    
6     use Test::More tests => 3846;
7     use blib;
8     use jsFind;
9    
10     BEGIN { use_ok('jsFind'); }
11    
12     my @base62 = qw(
13     0 1 2 3 4 5 6 7 8 9
14     a b c d e f g h i j k l m n o p q r s t u v w x y z
15     A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
16     );
17    
18     my @nr;
19    
20     diag "generating test base62 numbers";
21    
22     foreach my $l (@base62) {
23     foreach my $r (@base62) {
24     if ($l eq '0') {
25     push @nr, $r;
26     } else {
27     push @nr, $l.$r;
28     }
29     }
30     }
31    
32     cmp_ok(scalar @nr, '==', 3844, "generated 3844 numbers");
33    
34     my $i = 0;
35     foreach my $nr (@nr) {
36     cmp_ok($nr, 'eq', jsFind::Node::base62(undef,$i),"base62($i) == $nr");
37     $i++;
38     }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26